### Question:
NotPredicate implements Predicate<T> { @Override public boolean test(T input) { return !myPredicate.test(input); } NotPredicate(Predicate<T> predicate); @Override boolean test(T input);  }### Answer:
@Test public void test() { Predicate<Void> truePredicate = new Predicate<Void>() { @Override public boolean test(Void input) { return true; } }; Assert.assertFalse(new NotPredicate<>(truePredicate).test(null)); Predicate<Void> falsePredicate = new Predicate<Void>() { @Override public boolean test(Void input) { return false; } }; Assert.assertTrue(new NotPredicate<>(falsePredicate).test(null)); }