Pair implements Serializable { private Pair(final A left, final B right) { this.left = left; this.right = right; } private  Pair(final A left, final B right); A left(); B right(); @Override String toString(); @Override boolean equals(final Object obj); @Override int hashCode(); static Pair<A, B> of(final A left, final B right);  }
@Test public void testPair() { final Pair<Object, Object> objectPair = Pair.of(leftObject, rightObject); final Pair<Object, Object> identicalObjectPair = Pair.of(leftObject, rightObject); final Pair<IRVertex, IRVertex> irVertexPair = Pair.of(leftSource, rightSource); final Pair<Object, IRVertex> mixedPair = Pair.of(leftObject, rightSource); assertEquals(leftObject, objectPair.left()); assertEquals(rightObject, objectPair.right()); assertEquals(leftSource, irVertexPair.left()); assertEquals(rightSource, irVertexPair.right()); assertEquals(leftObject, mixedPair.left()); assertEquals(rightSource, mixedPair.right()); assertEquals(objectPair, identicalObjectPair); }