@Test
public void testEqualsObject() {

  Pair<String, Integer> p1 = new Pair<String, Integer>("a", 123123);
  Pair<String, Integer> p2 = new Pair<String, Integer>("a", 123123);
  assertTrue(p1.equals(p2));
  p1 = new Pair<String, Integer>("a", null);
  p2 = new Pair<String, Integer>("a", 123123);
  assertFalse(p1.equals(p2));
  p1 = new Pair<String, Integer>("a", 123123);
  p2 = new Pair<String, Integer>("a", null);
  assertFalse(p1.equals(p2));
  p1 = new Pair<String, Integer>(null, 123123);
  p2 = new Pair<String, Integer>("a", 123123);
  assertFalse(p1.equals(p2));
  p1 = new Pair<String, Integer>("a", 123123);
  p2 = new Pair<String, Integer>(null, 123123);
  assertFalse(p1.equals(p2));
  p1 = new Pair<String, Integer>(null, 123123);
  p2 = null;
  assertFalse(p1.equals(p2));
  p1 = new Pair<String, Integer>(null, 123123);
  p2 = new Pair<String, Integer>(null, 123123);
  Map<Pair<String, Integer>, Integer> map = new HashMap<Pair<String, Integer>, Integer>();
  map.put(p1, 1);
  assertTrue(map.containsKey(p2));
  assertTrue(p1.equals(p2));
  p1 = new Pair<String, Integer>("a", null);
  p2 = new Pair<String, Integer>("a", null);
  assertTrue(p1.equals(p2));
  assertTrue(p1.equals(p1));
  assertFalse(p1.equals(new Integer(1)));
}