### Question:
NullaryFunctionNullaryProcedure implements NullaryProcedure { public void run() { function.evaluate(); } NullaryFunctionNullaryProcedure(NullaryFunction<?> function); void run(); @Override boolean equals(Object obj); @Override int hashCode(); @Override String toString(); static NullaryFunctionNullaryProcedure adapt(NullaryFunction<?> function);  }### Answer:
@Test public void testRun() throws Exception { class EvaluateCounter implements NullaryFunction<Integer> { int count = 0; public Integer evaluate() { return Integer.valueOf(count++); } } EvaluateCounter counter = new EvaluateCounter(); NullaryProcedure p = new NullaryFunctionNullaryProcedure(counter); assertEquals(0,counter.count); p.run(); assertEquals(1,counter.count); p.run(); assertEquals(2,counter.count); }