@Test
public void testSearchObjectsWithSearchResult() {

  UUID id = UUID.randomUUID();
  ObjectDocument document = new ObjectDocument().setId(id);
  ObjectEntity entity = new ObjectEntity().setId(id);
  ObjectRecord record = new ObjectRecord().setId(id);
  FactSearchCriteria criteria = createFactSearchCriteria();
  when(factSearchManager.searchObjects(criteria))
          .thenReturn(SearchResult.<ObjectDocument>builder().setCount(1).addValue(document).build());
  when(objectManager.getObjects(anyList())).thenReturn(ListUtils.list(entity).iterator());
  when(objectRecordConverter.fromEntity(entity)).thenReturn(record);
  ResultContainer<ObjectRecord> container = dao.searchObjects(criteria);
  assertEquals(1, container.getCount());
  assertEquals(ListUtils.list(record), ListUtils.list(container));
  verify(factSearchManager).searchObjects(criteria);
  verify(objectManager).getObjects(argThat(list -> list.contains(id)));
  verify(objectRecordConverter).fromEntity(entity);
}