public static void unifyReferences(final Hashtable hash,final List list){
  if (list != null) {
    for (int i=0; i < list.size(); i++) {
      final Object itemAtList=list.get(i);
      final Object unifiedReferences=unifyReferences(hash,itemAtList);
      list.set(i,unifiedReferences);
    }
  }
}

public static void unifyReferences ( final Hashtable hash , final List list ) { if ( list != null ) { for ( int i = 0 ; i < list . size ( ) ; i ++ ) { final Object itemAtList = list . get ( i ) ; final Object unifiedReferences = unifyReferences ( hash , itemAtList ) ; list . set ( i , unifiedReferences ) ; } } }
unify the objects in the list according to the hash code important : hashcode usage here is different from the java spec , it should be uniuque for each object which should hold somthing like the database primary key .
