OperationServiceImpl implements OperationService { @Override public Long getMostRecentId() { return (Long) memcacheService.get(MemcacheKey.DB_OPERATION_COUNTER.getName()); } @Inject  OperationServiceImpl(
            MemcacheService memcacheService); @Override Long getMostRecentId(); List<DbOperationRecordDto> getOperations(Long lastId, Integer limit);  }
@Test public void testGetMostRecentIdReturnNull() { when(memcacheService.get(MemcacheKey.DB_OPERATION_COUNTER.getName())).thenReturn(null); Long mostRecentId = operationService.getMostRecentId(); verify(memcacheService).get(MemcacheKey.DB_OPERATION_COUNTER.getName()); assertNull(mostRecentId); }