SetView extends CollectionView<E> implements Set<E> { public int hashCode() { return this.collection.hashCode(); } SetView(Set<E> set); boolean equals(Object obj); int hashCode();  }
@Test public void testHashCode() { Set comp = new HashSet(); assertEquals(comp.hashCode(), this.testobj.hashCode()); for (int i = 0; i < 5; ++i) { this.source.add(String.valueOf(i)); assertNotEquals(comp.hashCode(), this.testobj.hashCode()); comp.add(String.valueOf(i)); assertEquals(comp.hashCode(), this.testobj.hashCode()); } this.source.clear(); assertNotEquals(comp.hashCode(), this.testobj.hashCode()); comp.clear(); assertEquals(comp.hashCode(), this.testobj.hashCode()); }