Ngram implements Bigram<T>, Trigram<T>,
    Comparable<Ngram<T>>,
    Serializable { @Override public T getThird() { if (length != 3) { throw new UnsupportedOperationException(); } return atIndex(2); } 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 testGetThirdBigram() { assertThrows(UnsupportedOperationException.class, () -> bigram.getThird()); }
@Test void testGetThird() { String third = trigram.getThird(); assertEquals(third, "third", "Third should return the third object in a trigram"); }