Solved RemoveDuplicatesFromSortedList in java