@Override public boolean equals(Object o){
  if (o == null) {
    return false;
  }
  if (!(o instanceof Collection)) {
    return false;
  }
  final Collection<?> other=(Collection<?>)o;
  final Iterator<?> self_iter=iterator();
  final Iterator<?> othr_iter=other.iterator();
  while (self_iter.hasNext() && othr_iter.hasNext()) {
    if (!Objects.equals(self_iter.next(),othr_iter.next()))     return false;
  }
  return !(self_iter.hasNext() || othr_iter.hasNext());
}

@ Override public boolean equals ( Object o ) { if ( o == null ) { return false ; } if ( ! ( o instanceof Collection ) ) { return false ; } final Collection < ? > other = ( Collection < ? > ) o ; final Iterator < ? > self_iter = iterator ( ) ; final Iterator < ? > othr_iter = other . iterator ( ) ; while ( self_iter . hasNext ( ) && othr_iter . hasNext ( ) ) { if ( ! Objects . equals ( self_iter . next ( ) , othr_iter . next ( ) ) ) return false ; } return ! ( self_iter . hasNext ( ) || othr_iter . hasNext ( ) ) ; }
list equality : compare each element in sequence for equality . the equality for a list is defined in the documentation of the list interface : https : / / docs . oracle . com / javase / 7 / docs / api / java / util / list . html # equals % 28java . lang . object % 29 note that lombok won ' t generate the correct equals ( ) and hashcode ( ) , as it will compare the members of the object , none of which has a defined equality and thus will never compare equal .
