### Question:
Constant implements NullaryFunction<T>, Function<Object, T>, BinaryFunction<Object, Object, T>,
        NullaryPredicate, Predicate<Object>, BinaryPredicate<Object, Object> { @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof Constant<?>)) { return false; } Constant<?> that = (Constant<?>) obj; return null == this.value ? null == that.value : this.value.equals(that.value); } Constant(T value); T evaluate(); T evaluate(Object obj); T evaluate(Object left, Object right); boolean test(); boolean test(Object obj); boolean test(Object left, Object right); @Override boolean equals(Object obj); @Override int hashCode(); @Override String toString(); static Constant<Boolean> truePredicate(); static Constant<Boolean> falsePredicate(); static Constant<Boolean> predicate(boolean value); static Constant<T> of(T value); static final Constant<Boolean> TRUE; static final Constant<Boolean> FALSE; }### Answer:
@Test public void testEquals() throws Exception { Constant<Object> f = new Constant<Object>("xyzzy"); assertEquals(f, f); assertObjectsAreEqual(f, new Constant<Object>("xyzzy")); assertObjectsAreNotEqual(f, new Constant<Object>("abcde")); assertObjectsAreNotEqual(f, new Constant<Object>(null)); assertObjectsAreEqual(new Constant<Object>(null), new Constant<Object>(null)); assertTrue(!f.equals(null)); }