### Question:
BoundNullaryFunction implements NullaryFunction<T> { @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof BoundNullaryFunction<?>)) { return false; } BoundNullaryFunction<?> that = (BoundNullaryFunction<?>) obj; if (!(that.function.equals(this.function))) { return false; } return that.arg == this.arg || that.arg != null && that.arg.equals(this.arg); } @SuppressWarnings("unchecked") <A> BoundNullaryFunction(Function<? super A, ? extends T> function, A arg); T evaluate(); @Override boolean equals(Object obj); @Override int hashCode(); @Override String toString(); static BoundNullaryFunction<T> bind(Function<? super A, ? extends T> function, A arg);  }### Answer:
@Test public void testEquals() throws Exception { NullaryFunction<Object> f = new BoundNullaryFunction<Object>(Identity.INSTANCE,"xyzzy"); assertEquals(f,f); assertObjectsAreEqual(f,new BoundNullaryFunction<Object>(Identity.INSTANCE,"xyzzy")); assertObjectsAreNotEqual(f,Constant.of("xyzzy")); assertObjectsAreNotEqual(f,new BoundNullaryFunction<Object>(Identity.INSTANCE,"foo")); assertObjectsAreNotEqual(f,new BoundNullaryFunction<Object>(Constant.of("xyzzy"),"foo")); assertObjectsAreNotEqual(f,new BoundNullaryFunction<Object>(Identity.INSTANCE,null)); assertTrue(!f.equals(null)); }