public static int amountKurse (List<Studie> lstd) {
int result = (int) lstd.stream().map(Studie::getKurse).count();
return result;
}
private Map<Kurs,Integer> kurse = new HashMap<>();
public Set<Kurs> getKurse(){
return kurse.keySet();
}
I want to count the number of Kurse in all my Studie objects.
My current result is 20, when it should be 132
I am guessing that my function is only counting the amount of Studie
Would be grateful for some help on this.