### Question:
List extends Collection<E> implements Equatable<List<E>> { @Override public int hashCode() { int result = 1; for (E item : this) { result = (31 * result) + (item == null ? 0 : item.hashCode()); } return result; } protected  List(); void add(int location, E object); @Override boolean add(E object); boolean addAll(int location, Collection<? extends E> collection); @Override boolean equals(Object object); @Override boolean equalTo(@Nullable List<E> otherList); abstract E get(int location); @Override int hashCode(); abstract int indexOf(E object); abstract int lastIndexOf(E object); abstract E remove(int location); abstract E set(int location, E object);  }### Answer:
@Test public void testHashCode() { List<Integer> list = new ArrayList<Integer>(); list.add(3); list.add(15); list.add(5); list.add(1); list.add(7); int hashCodeValue = 1; Iterator<Integer> i = list.iterator(); while (i.hasNext()) { Object obj = i.next(); hashCodeValue = 31 * hashCodeValue + (obj == null ? 0 : obj.hashCode()); } assertTrue("Incorrect hashCode returned. Wanted: " + hashCodeValue + " got: " + list.hashCode(), hashCodeValue == list.hashCode()); }