@@ -0,0 +1,2075 @@
+/*%0A1. %5BTests problem solving and a little bit of Java language%5D %0AWrite a Java method removeDuplicates that removes all duplicates in a given list. Assume the following:%0A%0Aa. The method accepts an object of type List%0Ab. The return type of the method is void%0Ac. Duplicates are determined using the equals() method (rather than by the == operator)%0A%0AYour implementation of removeDuplicates should handle, in an appropriate way, %0Athe case in which a null List is passed in to the method.%0ATest your method by writing code in a main method, which does the following:%0A%0Aa. It creates an instance of List and loads it with the following String values:%0A   %7B%22good%22, %22better%22, %22best%22, %22best%22, %22first%22, %22last%22, %22last%22, %22last%22,%22good%22%7D%0Ab. It invokes the removeDuplicatesMethod, passing in this instance of List%0Ac. It outputs the modified list to the console%0A*/%0A%0Aimport java.util.ArrayList;%0Aimport java.util.Arrays;%0A%0A%0Aclass QuestionOne%0A%7B%0A%09public static void main(String%5B%5D args) %7B%0A%09%09System.out.println(%22Question One%22);%0A%09%09ArrayList%3CString%3E duplicatesList = new ArrayList%3CString%3E(Arrays.asList(%22good%22, %22better%22, %22best%22, %22best%22, %22first%22, %22last%22, %22last%22, %22last%22,%22good%22));%0A%09%09removeDuplicates(duplicatesList);%0A%09%09// removeDuplicates(null);%0A%09%7D%0A%0A%09public static void removeDuplicates(ArrayList%3CString%3E strings) %7B%0A%09%09// null and empty check%0A%09%09if (strings == null %7C%7C strings.isEmpty()) %7B%0A%09%09%09System.out.println(%22The input list is null or has no items!%22);%0A%09%09%09return;%0A%09%09%7D%0A%0A%09%09ArrayList%3CString%3E uniqueStrings = new ArrayList%3CString%3E();%0A%09%09for (int i=0; i %3C strings.size(); i++) %7B%0A%09%09%09String item = strings.get(i);%0A%09%09%09if (!isContains(uniqueStrings, item))%0A%09%09%09%7B%0A%09%09%09%09uniqueStrings.add(item);%0A%09%09%09%7D%0A%09%09%7D%0A%09%09%0A%09%09// Print the result%0A%09%09for (int i = 0; i %3C uniqueStrings.size(); i++) %7B%0A%09%09%09System.out.println(uniqueStrings.get(i));%0A%09%09%7D %0A%09%7D // end removeDupliates%0A%0A%09// Return True if the list already contians the item%0A%09public static boolean isContains(ArrayList%3CString%3E strings, String item) %7B%0A%09%09for (int i = 0; i %3C strings.size(); i++) %7B%0A%09%09%09if (item.equals(strings.get(i))) %7B%0A%09%09%09%09%09return true;%0A%09%09%09%09%7D%09%0A%09%09%7D%0A%09%09return false;%0A%0A%09%7D%0A%7D

Add removeDuplicates method.