@Test
public void testSearchObjectsSingleBatchIncludeStatistics() throws Exception {

  int count = 3;
  when(objectFactDao.searchObjects(any())).thenReturn(createSearchResult(count));
  when(objectFactDao.calculateObjectStatistics(any())).thenReturn(ObjectStatisticsContainer.builder().build());
  ResultSet<Object> result = delegate.handle(new SearchObjectRequest().setIncludeStatistics(true));
  assertEquals(25, result.getLimit());
  assertEquals(count, result.getCount());
  assertEquals(count, ListUtils.list(result.iterator()).size());
  verify(objectFactDao).searchObjects(notNull());
  verify(objectFactDao).calculateObjectStatistics(argThat(criteria -> {
    assertNotNull(criteria.getCurrentUserID());
    assertNotNull(criteria.getAvailableOrganizationID());
    assertEquals(count, criteria.getObjectID().size());
    return true;
  }));
}