So I have the following class and the ArrayList of objects:
class Ticket{
String destination;
}
ArrayList<Ticket> tickets;
What I want is to get from my list a Map of String and Integer which contains the destinations from tickets and the number of occurences in my list for each destination. I think it would start like this, but I don't know how to continue:
Map<String,Integer> map=tickets.stream().filter(a->a.getDestination()).