Ngram implements Bigram<T>, Trigram<T>,
    Comparable<Ngram<T>>,
    Serializable { @Override public int hashCode() { int hashCode = 0; for (int i = 0; i < length; i++) { hashCode = 31 * hashCode + atIndex(i).hashCode(); } return hashCode; } Ngram(T[] backingArray, int length, int offset); static Ngram<S> create(S first, S second); static Ngram<S> create(S first, S second,
      S third); static Ngram<S> bigram(S[] array, int index); static Ngram<S> trigram(S[] array, int index); @Override Ngram<T> tail(); @Override Ngram<T> head(); @Override T getFirst(); @Override T getSecond(); @Override T getThird(); @Override int compareTo(Ngram<T> o); @Override Iterator<T> iterator(); @Override boolean equals(@Nullable Object o); @Override int hashCode(); @Override String toString();  }
@Test void testHashCodeNeq() { assertNotEquals(arrayTri.hashCode(), arrayBi.hashCode(), "hash code for ngram with different values should not be equal"); }
@Test void testHashCode() { assertEquals(arrayTri.hashCode(), Ngram.create("c", "d", "e").hashCode(), "hash code for objects with same value should be equal"); }