@Test
public void testSearchFactsFetchesUntilLimit() {

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