Pair { public static <T1, T2> Pair<T1, T2> of(T1 lhs, T2 rhs) { return new Pair<>(lhs, rhs); } Pair(T1 lhs, T2 rhs); static Pair<T1, T2> of(T1 lhs, T2 rhs); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); static Function<Pair<T1, T2>, T1> lhsFn(); static Function<Pair<T1, T2>, T2> rhsFn(); static Comparator<Pair<T1, ?>> lhsComparator(final Comparator<T1> comparator); final T1 lhs; final T2 rhs; }
@Test public void testOf() { Pair pair = new Pair("lhs", "rhs"); Pair pair2 = new Pair("foo", "bar"); Assert.assertEquals(pair2, pair.of("foo", "bar")); }