Pair { @Override public String toString() { return "[" + getKey() + ", " + getValue() + "]"; } Pair(K k, V v);  Pair(Pair<? extends K, ? extends V> entry); K getKey(); V getValue(); K getFirst(); V getSecond(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); static Pair<K, V> create(K k, V v);  }
@Test public void testToString() { Assert.assertEquals("[null, null]", new Pair<Object, Object>(null, null).toString()); Assert.assertEquals("[foo, 3]", new Pair<String, Integer>("foo", 3).toString()); }