Here is my function that removes duplicates from an arraylist (sorted in alphabetical order):
public static void removeDuplicate(ArrayList array