public static <T extends RelatedResourceRep>T findRef(Collection<T> resources,URI id){
  if ((resources != null) && (id != null)) {
    for (    T resource : resources) {
      if (id.equals(id(resource))) {
        return resource;
      }
    }
  }
  return null;
}

public static < T extends RelatedResourceRep > T findRef ( Collection < T > resources , URI id ) { if ( ( resources != null ) && ( id != null ) ) { for ( T resource : resources ) { if ( id . equals ( id ( resource ) ) ) { return resource ; } } } return null ; }
finds a resource reference within a collection by id .
