PredicatePageFilter extends PageFilter { @Override public boolean includes(Page pPage) { if (!super.includes(pPage)) { return false; } return predicate.evaluate(pPage); } PredicatePageFilter(Predicate predicate);  PredicatePageFilter(Predicate predicate, boolean includeInvalid, boolean includeHidden); @Override boolean includes(Page pPage);  }
@Test void testIncludesAccept() { when(predicate.evaluate(page)).thenReturn(true); assertTrue(underTest.includes(page)); }
@Test void testIncludesDeny() { when(predicate.evaluate(page)).thenReturn(false); assertFalse(underTest.includes(page)); }
@Test void testIncludesAccept_InvalidPage() { when(predicate.evaluate(page)).thenReturn(true); when(page.isValid()).thenReturn(false); assertFalse(underTest.includes(page)); }