### Question:
NoEffectPredicate implements Predicate<T> { @Override public boolean test(T input) { return Objects.equals(myFunction.apply(input), input); } NoEffectPredicate(Function<? super T, ? extends T> function); @Override boolean test(T input);  }### Answer:
@Test public void test() { Assert.assertTrue( new NoEffectPredicate<Boolean>(new ConstantFunction<Boolean, Boolean>(Boolean.TRUE)).test(Boolean.TRUE)); Assert.assertFalse( new NoEffectPredicate<Boolean>(new ConstantFunction<Boolean, Boolean>(Boolean.TRUE)).test(Boolean.FALSE)); Assert.assertFalse(new NoEffectPredicate<Boolean>(new ConstantFunction<Boolean, Boolean>(Boolean.TRUE)).test(null)); Assert.assertFalse(new NoEffectPredicate<Boolean>(new ConstantFunction<Boolean, Boolean>(null)).test(Boolean.TRUE)); }