protected void removeDuplicates(List<Node> list,Map<Node,Object> sortValues){
  HashSet<Object> distinctValues=new HashSet<Object>();
  for (Iterator<Node> iter=list.iterator(); iter.hasNext(); ) {
    Node node=iter.next();
    Object value=sortValues.get(node);
    if (distinctValues.contains(value)) {
      iter.remove();
    }
 else {
      distinctValues.add(value);
    }
  }
}

protected void removeDuplicates ( List < Node > list , Map < Node , Object > sortValues ) { HashSet < Object > distinctValues = new HashSet < Object > ( ) ; for ( Iterator < Node > iter = list . iterator ( ) ; iter . hasNext ( ) ; ) { Node node = iter . next ( ) ; Object value = sortValues . get ( node ) ; if ( distinctValues . contains ( value ) ) { iter . remove ( ) ; } else { distinctValues . add ( value ) ; } } }
removes items from the list which have duplicate values
