@Test(expectedExceptions = NullPointerException.class) public void test_or_null() { ObjLongPredicate<String> fn1 = (a, b) -> b > 3; fn1.or(null); }
public void test_or() { ObjLongPredicate<String> fn1 = (a, b) -> b > 3; ObjLongPredicate<String> fn2 = (a, b) -> a.length() > 3; ObjLongPredicate<String> or = fn1.or(fn2); assertEquals(fn1.test("a", 2L), false); assertEquals(fn1.test("a", 4L), true); assertEquals(fn2.test("a", 4L), false); assertEquals(fn2.test("abcd", 4L), true); assertEquals(or.test("a", 2L), false); assertEquals(or.test("a", 4L), true); assertEquals(or.test("abcd", 2L), true); assertEquals(or.test("abcd", 4L), true); }