I have these 2 methods working independently, basically doing the exact same thing to different data structures. Can you suggest a way to create a generic method instead of using 2?
Code:public String[] uniqueArguments(String[] arguments) {
Set<String> noDups = new HashSet<String>(Arrays.asList(arguments));
return noDups.toArray(new String[noDups.size()]);
}
Code:public static ArrayList<String> uniqueArguments(List<String> u) {
HashSet<String> mySet = new HashSet<String>(u);
return new ArrayList<String>(mySet);
}

