### Question:
ConstantItemScorer 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, fixedScore)); } return Results.newResultMap(results); } @Inject  ConstantItemScorer(@Value double  score); @Nonnull @Override ResultMap scoreWithDetails(long user, @Nonnull Collection<Long> items);  }### Answer:
@Test public void testScoreDetails() { ItemScorer pred = new ConstantItemScorer(5); ResultMap v = pred.scoreWithDetails(42, LongUtils.packedSet(1, 2, 3, 5, 7)); assertThat(v.keySet(), contains(1L, 2L, 3L, 5L, 7L)); assertThat(v.scoreMap().values(), everyItem(equalTo(5.0))); }