code: public static <T extends Collection<?>> T removeDuplicates(T input) {
          List<Object> unique = new ArrayList<>(input.size());
          for (Iterator<?> iter = input.iterator(); iter.hasNext(); ) {
              Object next = iter.next();
              if (unique.contains(next)) {
                  iter.remove();
              } else {
                  unique.add(next);
              }
          }
          return input;
      }
docs: Removes duplicate values by using the objects' equals function<br> Note that this function does not use a Set, because no hashcode is used.
  
  @param input collection
  @return the input collection