### Question:
Tuple2 implements Tuple { @Override public Object nth(int index) { assertIndexInBounds(index); if (index == 0) { return item1; } return item2; } protected  Tuple2(L left, R right); static Tuple2<L, R> of(L l, R r); L getItem1(); R getItem2(); Tuple2<T, R> mapItem1(Function<L, T> mapper); Tuple2<L, T> mapItem2(Function<R, T> mapper); @Override Object nth(int index); @Override List<Object> asList(); @Override boolean equals(Object o); @Override int hashCode(); int size(); @Override String toString();  }### Answer:
@Test public void testAccessingNegative() { assertThrows(IndexOutOfBoundsException.class, () -> somePair.nth(-1)); }
@Test public void testAccessingOutOfIndex() { assertThrows(IndexOutOfBoundsException.class, () -> somePair.nth(3)); }
@Test public void testNth() { assertThat(somePair.nth(0)).isEqualTo(1); assertThat(somePair.nth(1)).isEqualTo(3); assertThat(somePair.getItem1()).isEqualTo(1); assertThat(somePair.getItem2()).isEqualTo(3); assertThat(somePair.size()).isEqualTo(2); }