@Test
public void testSearchFactsFiltersNonAccessibleFacts() {

  mockSearch(3);
  when(securityContext.hasReadPermission(isA(FactRecord.class))).thenReturn(true, false, true);
  FactSearchCriteria criteria = createFactSearchCriteria(b -> b.setLimit(25));
  ResultSet<Fact> result = handler.search(criteria, null);
  assertEquals(25, result.getLimit());
  assertEquals(3, result.getCount());
  assertEquals(2, ListUtils.list(result.iterator()).size());
  verify(securityContext, times(3)).hasReadPermission(isA(FactRecord.class));
  verify(factResponseConverter, times(2)).apply(isA(FactRecord.class));
}