void (Filter.Result object, int expected) { Assert.assertNotNull(object); List<Filter.ResultItem> resultItems = object.getResultItems(); Assert.assertEquals(expected, resultItems.size()); for (Filter.ResultItem resultItem : resultItems) { Assert.assertNotNull(resultItem); } }