I am trying to \"combine\" two arrayLists, producing a new arrayList that contains all the numbers in the two combined arrayLists, but without any duplicate elements and the
Here is one solution using java 8:
Stream.of(list1, list2) .flatMap(Collection::stream) .distinct() // .sorted() uncomment if you want sorted list .collect(Collectors.toList());