@Test public void testPair() { final Pair<Integer, String> pair1 = Pair.create(1, "test"); final Pair<Integer, String> pair2 = Pair.create(1, "diff"); final Pair<Integer, String> pair3 = Pair.create(2, "test"); final Pair<Integer, String> pair4 = Pair.create(1, "test"); assertEquals(pair1, pair4); assertEquals(pair1.hashCode(), pair4.hashCode()); assertFalse(pair1.equals(pair2)); assertFalse(pair1.equals(pair3)); assertTrue(pair1.hashCode() != pair2.hashCode()); assertTrue(pair1.hashCode() != pair3.hashCode()); }
protected Pair(final T1 firstValue, final T2 secondValue) { first = firstValue; second = secondValue; }
Pair { protected Pair(final T1 firstValue, final T2 secondValue) { first = firstValue; second = secondValue; } }
Pair { protected Pair(final T1 firstValue, final T2 secondValue) { first = firstValue; second = secondValue; } protected  Pair(final T1 firstValue, final T2 secondValue); }
Pair { protected Pair(final T1 firstValue, final T2 secondValue) { first = firstValue; second = secondValue; } protected  Pair(final T1 firstValue, final T2 secondValue); static Pair<T1, T2> create(final T1 first, final T2 second); @Override boolean equals(final Object obj); @Override int hashCode(); @Override String toString(); }
Pair { protected Pair(final T1 firstValue, final T2 secondValue) { first = firstValue; second = secondValue; } protected  Pair(final T1 firstValue, final T2 secondValue); static Pair<T1, T2> create(final T1 first, final T2 second); @Override boolean equals(final Object obj); @Override int hashCode(); @Override String toString(); final T1 first; final T2 second; }