public static <T extends IdentifiableObject>List<T> removeDuplicates(List<T> list){
  final List<T> temp=new ArrayList<>(list);
  list.clear();
  for (  T object : temp) {
    if (!list.contains(object)) {
      list.add(object);
    }
  }
  return list;
}

public static < T extends IdentifiableObject > List < T > removeDuplicates ( List < T > list ) { final List < T > temp = new ArrayList < > ( list ) ; list . clear ( ) ; for ( T object : temp ) { if ( ! list . contains ( object ) ) { list . add ( object ) ; } } return list ; }
removes duplicates from the given list while maintaining the order .
