@Test public void testTest() throws Exception { ConditionalPredicate<Object> p = new ConditionalPredicate<Object>(Identity.INSTANCE, Constant.TRUE, Constant.FALSE); assertTrue(p.test(Boolean.TRUE)); assertTrue(!p.test(Boolean.FALSE)); }
@Test public void testEquals() throws Exception { ConditionalPredicate<Object> p = new ConditionalPredicate<Object>(Identity.INSTANCE, Constant.TRUE, Constant.TRUE); assertEquals(p, p); assertObjectsAreEqual( p, new ConditionalPredicate<Object>(Identity.INSTANCE, Constant.TRUE, Constant.TRUE)); assertObjectsAreNotEqual( p, new ConditionalPredicate<Object>(Identity.INSTANCE, Constant.FALSE, Constant.TRUE)); assertObjectsAreNotEqual( p, new ConditionalPredicate<Object>(Constant.TRUE, Constant.TRUE, Constant.TRUE)); assertObjectsAreNotEqual( p, new ConditionalPredicate<Object>(Identity.INSTANCE, Constant.TRUE, Constant.FALSE)); assertTrue(!p.equals(null)); }