EqualsDemo { @Override public boolean equals(Object o) { if (o == this) return true; if (o == null) return false; if (o.getClass() != EqualsDemo.class) return false; EqualsDemo other = (EqualsDemo)o; if (int1 != other.int1) return false; if (!obj1.equals(other.obj1)) return false; return true; } EqualsDemo(int i, SomeClass o);  EqualsDemo(); @Override boolean equals(Object o); @Override int hashCode();  }
@Test public void testSymmetric() { assertTrue(d1.equals(d2) && d2.equals(d1)); }
@Test public void testCaution() { assertFalse(d1.equals(null)); }
@Test public void testSymmetry() { assertTrue(d1.equals(d1)); }