In my assignment the third step is to Call the method merge to merge the two lists in list1 so that the list1 remains sorted.
I write my code but it
Easy fix: sort afterwards.
list1.addAll(list2); Collections.sort(list1);
Use sets to avoid duplicates.