Pair { @Override public String toString() { return "Pair{" + "lhs=" + lhs + ", rhs=" + 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 testToString() { Pair pair = new Pair("lhs", "rhs"); Assert.assertEquals("Pair{lhs=lhs, rhs=rhs}", pair.toString()); }