### Question:
Constant implements NullaryFunction<T>, Function<Object, T>, BinaryFunction<Object, Object, T>,
        NullaryPredicate, Predicate<Object>, BinaryPredicate<Object, Object> { public T evaluate() { return 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 testEvaluate() throws Exception { Constant<Object> f = new Constant<Object>("xyzzy"); assertEquals("xyzzy", f.evaluate()); assertEquals("xyzzy", f.evaluate(null)); assertEquals("xyzzy", f.evaluate(null, null)); assertEquals("xyzzy", f.evaluate()); assertEquals("xyzzy", f.evaluate("foo")); assertEquals("xyzzy", f.evaluate("foo", Integer.valueOf(2))); }
@Test public void testEvaluateConstantNull() throws Exception { Constant<Object> f = new Constant<Object>(null); assertNull(f.evaluate()); assertNull(f.evaluate(null)); assertNull(f.evaluate(null, null)); assertNull(f.evaluate()); assertNull(f.evaluate("foo")); assertNull(f.evaluate("foo", Integer.valueOf(2))); }