@Override public int hashCode(){
  int result=0;
  Iterator<?> it=iterator();
  while (it.hasNext()) {
    Object next=it.next();
    result+=next == null ? 0 : next.hashCode();
  }
  return result;
}

@ Override public int hashCode ( ) { int result = 0 ; Iterator < ? > it = iterator ( ) ; while ( it . hasNext ( ) ) { Object next = it . next ( ) ; result += next == null ? 0 : next . hashCode ( ) ; } return result ; }
returns the hash code for this set . two set which are equal must return the same value . this implementation calculates the hash code by adding each element ' s hash code .
