I have two ArrayList of String with list of ID.
List list1 -> ["1", "2", "3," "4", "5", "6"] and List list2 -> ["2", "3," "4", "6"]
I want to get a list of ID not repeated.
List list3 -> ["1", "5"]
I've developed this with Java 7:
for (String id : list1) {
if (!list2.contains(id)) {
list3.add(id);
}
}
I want to do this in Java functional programming... is possible using streams or similar?