### Question:
SimpleCachingItemScorer extends AbstractItemScorer { public ResultMap getCache() { return cachedScores; } @Inject  SimpleCachingItemScorer(ItemScorer sc); @Nonnull @Override ResultMap scoreWithDetails(long user, @Nonnull Collection<Long> items); long getId(); ResultMap getCache();  }### Answer:
@Test public void testCachedScores() { Long user = 3L; LongSortedSet items = LongUtils.packedSet(1, 2); cachedScorer.score(user, items); assertThat(cachedScorer.getCache().keySet(), equalTo((Set) items)); cachedScorer.score(user, 4); assertThat(cachedScorer.getCache().keySet(), equalTo((Set) LongUtils.packedSet(1, 2, 4))); }