public static <T extends DataObject>T findInCollection(Collection<T> col,T obj){
  if (col != null && obj != null) {
    return findInCollection(col,obj.getId());
  }
  return null;
}

public static < T extends DataObject > T findInCollection ( Collection < T > col , T obj ) { if ( col != null && obj != null ) { return findInCollection ( col , obj . getId ( ) ) ; } return null ; }
finds an dataobject in a collection by matching it by id
