### Question:
ConditionalNullaryProcedure implements NullaryProcedure { @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof ConditionalNullaryProcedure)) { return false; } ConditionalNullaryProcedure that = (ConditionalNullaryProcedure) obj; return this.ifPred.equals(that.ifPred) && this.thenProc.equals(that.thenProc) && this.elseProc.equals(that.elseProc); } ConditionalNullaryProcedure(NullaryPredicate ifPred, NullaryProcedure thenProc);  ConditionalNullaryProcedure(NullaryPredicate ifPred, NullaryProcedure thenProc, NullaryProcedure elseProc); void run(); @Override boolean equals(Object obj); @Override int hashCode(); @Override String toString();  }### Answer:
@Test public void testEquals() throws Exception { ConditionalNullaryProcedure p = new ConditionalNullaryProcedure( Constant.FALSE, NoOp.INSTANCE, NoOp.INSTANCE); assertEquals(p,p); assertObjectsAreEqual(p,new ConditionalNullaryProcedure( Constant.FALSE, NoOp.INSTANCE, NoOp.INSTANCE)); assertObjectsAreNotEqual(p,new ConditionalNullaryProcedure( Constant.TRUE, NoOp.INSTANCE, NoOp.INSTANCE)); assertObjectsAreNotEqual(p,new ConditionalNullaryProcedure( Constant.TRUE, NoOp.INSTANCE, NoOp.INSTANCE)); assertObjectsAreNotEqual(p,new ConditionalNullaryProcedure( Constant.FALSE, new RunCounter(), NoOp.INSTANCE)); assertObjectsAreNotEqual(p,new ConditionalNullaryProcedure( Constant.FALSE, NoOp.INSTANCE, new RunCounter())); assertObjectsAreNotEqual(p,new ConditionalNullaryProcedure( Constant.TRUE, NoOp.INSTANCE)); assertTrue(!p.equals(null)); }