@Override
    public boolean equals( Object o ) {
        if( o == this ) {
            return true;
        }
        if( !( o instanceof LongSet ) ) {
            return false;
        }

        LongSet m = (LongSet)o;
        if( m.size() != size() ) {
            return false;
        }

        try {
            LongIterator iter = iterator();
            while( iter.hasNext() ) {
                if( !contains( iter.next() ) ) {
                    return false;
                }
            }
        } catch( ClassCastException unused ) {
            return false;
        } catch( NullPointerException unused ) {
            return false;
        }

        return true;
    }