Tuple { public static final <U, V> Tuple<U, V> of(U first, V second) { return new Tuple<>(first, second); } private  Tuple(S first, T second); static final Tuple<U, V> of(U first, V second); final S first; final T second; }
@Test public void testElementAccess() { Tuple<Integer, Integer> tuple = Tuple.of(1, 2); Assert.assertEquals(1, (int)tuple.first); Assert.assertEquals(2, (int)tuple.second); }