public boolean equals(Object obj){
  if (obj == this) {
    return true;
  }
  if (obj instanceof Map == false) {
    return false;
  }
  Map map=(Map)obj;
  if (map.size() != size()) {
    return false;
  }
  MapIterator it=mapIterator();
  try {
    while (it.hasNext()) {
      Object key=it.next();
      Object value=it.getValue();
      if (value == null) {
        if (map.get(key) != null || map.containsKey(key) == false) {
          return false;
        }
      }
 else {
        if (value.equals(map.get(key)) == false) {
          return false;
        }
      }
    }
  }
 catch (  ClassCastException ignored) {
    return false;
  }
catch (  NullPointerException ignored) {
    return false;
  }
  return true;
}

public boolean equals ( Object obj ) { if ( obj == this ) { return true ; } if ( obj instanceof Map == false ) { return false ; } Map map = ( Map ) obj ; if ( map . size ( ) != size ( ) ) { return false ; } MapIterator it = mapIterator ( ) ; try { while ( it . hasNext ( ) ) { Object key = it . next ( ) ; Object value = it . getValue ( ) ; if ( value == null ) { if ( map . get ( key ) != null || map . containsKey ( key ) == false ) { return false ; } } else { if ( value . equals ( map . get ( key ) ) == false ) { return false ; } } } } catch ( ClassCastException ignored ) { return false ; } catch ( NullPointerException ignored ) { return false ; } return true ; }
compares this map with another .
