ClientCache { public Collection<Client> getCachedClients() { Set<String> keys = nativeCache.keySet(); if(keys.size() > 0) { return nativeCache.get(keys.iterator().next()); } return Collections.emptyList(); } ClientCache(CacheManager cacheManager); void clearCache(); Collection<Client> getCachedClients();  }
@Test public void shouldReturnClientFromCache() { cachedClientGetter.getBestClients(); Collection<Client> cachedClients = clientCache.getCachedClients(); assertThat(cachedClients).hasSize(10); }
@Test public void shouldReturnEmptyCollectionWhen() { Collection<Client> cachedClients = clientCache.getCachedClients(); assertThat(cachedClients).isEmpty(); }