### Question:
ConditionalNullaryProcedure implements NullaryProcedure { public void run() { if (ifPred.test()) { thenProc.run(); } else { elseProc.run(); } } 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 testRun() throws Exception { { RunCounter left = new RunCounter(); RunCounter right = new RunCounter(); ConditionalNullaryProcedure p = new ConditionalNullaryProcedure( Constant.TRUE, left, right); assertEquals(0,left.count); assertEquals(0,right.count); p.run(); assertEquals(1,left.count); assertEquals(0,right.count); p.run(); assertEquals(2,left.count); assertEquals(0,right.count); p.run(); assertEquals(3,left.count); assertEquals(0,right.count); } { RunCounter left = new RunCounter(); RunCounter right = new RunCounter(); ConditionalNullaryProcedure p = new ConditionalNullaryProcedure( Constant.FALSE, left, right); assertEquals(0,left.count); assertEquals(0,right.count); p.run(); assertEquals(0,left.count); assertEquals(1,right.count); p.run(); assertEquals(0,left.count); assertEquals(2,right.count); p.run(); assertEquals(0,left.count); assertEquals(3,right.count); } }