I want to point to the item that is on each list. Lists are kept in List <Set >. The point is, in each of the lists, it stores several numbers. I want to add to qSE the numbers that will appear in each of the lists. What should I add in the code to make it work as it should?
public static Set<Integer> getSameElements(List<Set<Integer>> listOfElements){
Set<Integer> gSE = new HashSet<>();
for (Set<Integer> list : listOfElements){
for (int number : list){
}
}
}
return gSE;
}