Ngram implements Bigram<T>, Trigram<T>,
    Comparable<Ngram<T>>,
    Serializable { @Override public Ngram<T> head() { if (length != 3) { throw new UnsupportedOperationException(); } return new Ngram<>(backingArray, 2, offset); } 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 testHeadBigram() { assertThrows(UnsupportedOperationException.class, () -> bigram.head()); }
@Test void testHead() { Ngram<String> head = arrayTri.head(); assertEquals(head, Ngram.create("c", "d"), "Head should return a bigram of the first two objects of a trigram"); }