### Question:
PopularityRankItemScorer extends AbstractItemScorer implements Serializable { @Nonnull @Override public ResultMap scoreWithDetails(long user, @Nonnull Collection<Long> items) { List<Result> results = new ArrayList<>(items.size()); LongIterator iter = LongIterators.asLongIterator(items.iterator()); while (iter.hasNext()) { long item = iter.nextLong(); results.add(Results.create(item, rankScores.get(item))); } return Results.newResultMap(results); } @Inject  PopularityRankItemScorer(final InteractionStatistics stats); @Nonnull @Override Map<Long, Double> score(long user, @Nonnull Collection<Long> items); @Nonnull @Override ResultMap scoreWithDetails(long user, @Nonnull Collection<Long> items);  }### Answer:
@Test public void testScoreItems() { ResultMap results = recommender.scoreWithDetails(42, LongUtils.packedSet(1, 2, 3)); assertThat(results.size(), equalTo(3)); assertThat(results.getScore(1), equalTo(1.0)); assertThat(results.getScore(2), equalTo(0.5)); assertThat(results.getScore(3), equalTo(0.0)); }