NotPredicate implements SerializablePredicate<T> { @Override public boolean test(T t) { return !operand.test(t); } NotPredicate(SerializablePredicate<T> predicate); @Override boolean test(T t); SerializablePredicate<T> getOperand();  }
@Test public void test() { EqualsPredicate<TestEntity> p1 = new EqualsPredicate<>("name", "Bob"); NotPredicate<TestEntity> not = new NotPredicate<>(p1); TestEntity t1 = new TestEntity(); t1.setName("Bob"); assertFalse(not.test(t1)); t1.setName("Rob"); assertTrue(not.test(t1)); }