DisjunctionRequestFilter implements RequestFilter { @Override public boolean shouldSkip(HttpServletRequest request) { boolean result = false; for (int i = 0; !result && i < requestFilters.length; i++) { result = requestFilters[i].shouldSkip(request); } return result; } DisjunctionRequestFilter(
      RequestFilter requestFilterA,
      RequestFilter requestFilterB,
      RequestFilter... anotherRequestFilters); @Override boolean shouldSkip(HttpServletRequest request);  }
@Test(dataProvider = "skip") public void testShouldSkip(List<RequestFilter> requestFilters) throws Exception { RequestFilter[] filters = (RequestFilter[]) requestFilters.toArray(); DisjunctionRequestFilter filter = new DisjunctionRequestFilter( filters[0], filters[1], Arrays.copyOfRange(filters, 2, filters.length)); boolean result = filter.shouldSkip(request); Assert.assertTrue(result); }
@Test(dataProvider = "notskip") public void testShouldNotSkip(List<RequestFilter> requestFilters) throws Exception { RequestFilter[] filters = (RequestFilter[]) requestFilters.toArray(); DisjunctionRequestFilter filter = new DisjunctionRequestFilter( filters[0], filters[1], Arrays.copyOfRange(filters, 2, filters.length)); boolean result = filter.shouldSkip(request); Assert.assertFalse(result); }