Or extends Logic { @Override public boolean equals(Object a) { if (!(a instanceof Or)) { return false; } return super.equals(a); } Or();  Or(Constraint... subConstraints);  Or(List<Constraint> asList); @Override String toString(); @Override boolean equals(Object a); @Override int hashCode();  }
@Test public void testEquals() { Constraint myconstraint1 = createMock(Constraint.class); Constraint myconstraint2 = createMock(Constraint.class); Constraint myconstraint3 = createMock(Constraint.class); Constraint myconstraint4 = createMock(Constraint.class); Or myOr1 = new Or(myconstraint1, myconstraint2); Or myOr2 = new Or(myconstraint4, myconstraint3); Assert.assertFalse(myOr1.equals(null)); Assert.assertFalse(myOr1.equals(myOr2)); Assert.assertTrue(myOr1.equals(myOr1)); }