### Question:
TransformedNullaryProcedure implements NullaryProcedure { @Override public final boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof TransformedNullaryProcedure)) { return false; } TransformedNullaryProcedure that = (TransformedNullaryProcedure) obj; return this.helper.function.equals(that.helper.function) && this.helper.procedure.equals(that.helper.procedure); } <X> TransformedNullaryProcedure(NullaryFunction<? extends X> function, Procedure<? super X> procedure); final void run(); @Override final boolean equals(Object obj); @Override int hashCode(); @Override String toString();  }### Answer:
@Test public void testEquals() { TransformedNullaryProcedure t = new TransformedNullaryProcedure(one, aggregator); NullaryFunction<Integer> f = new NullaryFunction<Integer>() { public Integer evaluate() { return Integer.valueOf(2); } }; Procedure<Integer> p = new Procedure<Integer>() { public void run(Integer obj) { } }; assertEquals(t, t); assertObjectsAreEqual(t, new TransformedNullaryProcedure(one, aggregator)); assertObjectsAreNotEqual(t, new TransformedNullaryProcedure(f, aggregator)); assertObjectsAreNotEqual(t, new TransformedNullaryProcedure(one, p)); assertTrue(!t.equals(null)); }