ListView extends CollectionView<E> implements List<E> { public int hashCode() { return this.collection.hashCode(); } ListView(List<E> list); void add(int index, E element); boolean addAll(int index, Collection<? extends E> collection); boolean equals(Object obj); E get(int index); int hashCode(); int indexOf(Object obj); int lastIndexOf(Object obj); ListIterator<E> listIterator(); ListIterator<E> listIterator(int index); E remove(int index); E set(int index, E element); List<E> subList(int fromIndex, int toIndex);  }
@Test @Override public void testHashCode() { List comp = new LinkedList(); 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()); }