### Question:
ImmutableAppendedList implements List<T> { @Override public int hashCode() { if (hc == 0) { int hashCode = 1; for (T element : this) { hashCode = 31 * hashCode + (element == null ? 0 : element.hashCode()); } hc = hashCode; } return hc; } ImmutableAppendedList( List<T> parent,
                                  T element ); boolean contains( Object o ); boolean containsAll( Collection<?> c ); T get( int index ); int indexOf( Object o ); boolean isEmpty(); @SuppressWarnings( "synthetic-access" ) Iterator<T> iterator(); int lastIndexOf( Object o ); ListIterator<T> listIterator(); @SuppressWarnings( "synthetic-access" ) ListIterator<T> listIterator( final int index ); int size(); List<T> subList( int fromIndex,
                            int toIndex ); Object[] toArray(); @SuppressWarnings( "unchecked" ) X[] toArray( X[] a ); @Override int hashCode(); @Override boolean equals( Object obj ); @Override String toString(); void add( int index,
                     T element ); boolean add( T o ); boolean addAll( Collection<? extends T> c ); boolean addAll( int index,
                           Collection<? extends T> c ); void clear(); boolean remove( Object o ); T remove( int index ); boolean removeAll( Collection<?> c ); boolean retainAll( Collection<?> c ); T set( int index,
                  T element );  }### Answer:
@Test public void shouldReturnSameHashCodeMultipleTimes() { int hc = list.hashCode(); for (int i = 0; i != 100; ++i) { assertThat(list.hashCode(), is(hc)); } }
@Test public void shouldReturnSameHashCodeAsEquivalentArrayList() { List<String> copy = new ArrayList<String>(list); assertThat(list.hashCode(), is(copy.hashCode())); }