@Test
public void testGetOperationLimitNotNullAndMostRecentIdGreaterThanLastIdPlusLimit(
        DbOperationRecordDto dtoFromMemCache1,
        DbOperationRecordDto dtoFromMemCache2, DbOperationRecordDto dtoFromMemCache3) {

    // Given
    Long lastId = 1L;
    when(memcacheService.get(MemcacheKey.DB_OPERATION_COUNTER.getName())).thenReturn(5L);
    Map<String, Object> mapFromMemCache = Maps.newHashMap();
    mapFromMemCache.put("dummyKey1", dtoFromMemCache1);
    mapFromMemCache.put("dummyKey2", dtoFromMemCache2);
    mapFromMemCache.put("dummyKey3", dtoFromMemCache3);
    when(memcacheService.getAll(anyCollection())).thenReturn(mapFromMemCache);
    // when
    List<DbOperationRecordDto> results = operationService.getOperations(lastId, 3);
    // then
    verify(memcacheService).get(MemcacheKey.DB_OPERATION_COUNTER.getName());
    verify(memcacheService).getAll(Lists.newArrayList(MemcacheKey.DB_OPERATION_RECORD_PREFIX.getName() +
            2, MemcacheKey.DB_OPERATION_RECORD_PREFIX.getName() + 3,
            MemcacheKey.DB_OPERATION_RECORD_PREFIX.getName() +
                    4));
    assertEquals(3, results.size());
    assertEquals(dtoFromMemCache1, results.get(0));
    assertEquals(dtoFromMemCache2, results.get(1));
    assertEquals(dtoFromMemCache3, results.get(2));
}