### Question:
SimpleRatingPredictor implements RatingPredictor { @Nonnull @Override public ResultMap predictWithDetails(long user, @Nonnull Collection<Long> items) { ResultMap scores = scorer.scoreWithDetails(user, items); List<Result> rescored = new ArrayList<>(scores.size()); for (Result r: scores) { double val = r.getScore(); if (preferenceDomain != null) { val = preferenceDomain.clampValue(val); } rescored.add(Results.rescore(r, val)); } return Results.newResultMap(rescored); } @Inject  SimpleRatingPredictor(@Nonnull @PredictionScorer ItemScorer s,
                                 @Nullable PreferenceDomain dom); @Nonnull ItemScorer getItemScorer(); @Nullable PreferenceDomain getPreferenceDomain(); @Override RescoredResult predict(long user, long item); @Nonnull @Override Map<Long, Double> predict(long user, @Nonnull Collection<Long> items); @Nonnull @Override ResultMap predictWithDetails(long user, @Nonnull Collection<Long> items);  }### Answer:
@Test public void testBulkPredictWithDetails() { ResultMap scores = pred.predictWithDetails(40, LongUtils.packedSet(1, 2, 3, 4)); assertThat(scores.size(), equalTo(3)); assertThat(scores.getScore(1), equalTo(4.0)); assertThat(scores.getScore(2), equalTo(5.0)); assertThat(scores.getScore(3), equalTo(1.0)); assertThat(scores.get(4L), nullValue()); }