### Question:
RestrictedByItem extends ProtectedItem { @Override public boolean equals( Object o ) { if ( this == o ) { return true; } if ( o instanceof RestrictedByItem ) { RestrictedByItem that = ( RestrictedByItem ) o; if ( items != null ) { if ( that.items == null ) { return false; } if ( items.size() != that.items.size() ) { return false; } for ( RestrictedByElem item : items ) { if ( !that.items.contains( item ) ) { return false; } } return true; } else { return that.items == null; } } return false; } RestrictedByItem( Set<RestrictedByElem> items ); Iterator<RestrictedByElem> iterator(); @Override int hashCode(); @Override boolean equals( Object o ); @Override String toString();  }### Answer:
@Test public void testEqualsNotInstanceOf() throws Exception { assertFalse( restrictedByItemA.equals( UndefinedNode.UNDEFINED_NODE ) ); }
@Test public void testEqualsNull() throws Exception { assertFalse( restrictedByItemA.equals( null ) ); }
@Test public void testNotEqualDiffValue() throws Exception { assertFalse( restrictedByItemA.equals( restrictedByItemC ) ); assertFalse( restrictedByItemC.equals( restrictedByItemA ) ); assertFalse( restrictedByItemA.equals( restrictedByItemD ) ); assertFalse( restrictedByItemD.equals( restrictedByItemA ) ); }