.addScore(42, 2, 3.0)
.addScore(42, 3, 3.0)
.build();
ItemScorer scorer = new FallbackItemScorer(primary, base1);
RatingPredictor pred = new SimpleRatingPredictor(scorer, base2, null);
MutableSparseVector vec = MutableSparseVector.create(1, 2, 3);
pred.predict(42, vec);
assertThat(vec.size(), equalTo(3));
assertThat(vec.get(1), equalTo(3.5));
assertThat(vec.get(2), equalTo(2.5));
assertThat(vec.get(3), equalTo(3.0));
assertThat(vec.getChannel(FallbackItemScorer.SCORE_SOURCE_SYMBOL).get(1),
equalTo(ScoreSource.PRIMARY));
assertThat(vec.getChannel(FallbackItemScorer.SCORE_SOURCE_SYMBOL).get(2),
equalTo(ScoreSource.BASELINE));
assertThat(vec.getChannel(FallbackItemScorer.SCORE_SOURCE_SYMBOL).get(3),
nullValue());
assertThat(vec.getChannel(SimpleRatingPredictor.PREDICTION_SOURCE_SYMBOL).get(1),
equalTo(ScoreSource.PRIMARY));
assertThat(vec.getChannel(SimpleRatingPredictor.PREDICTION_SOURCE_SYMBOL).get(2),
equalTo(ScoreSource.PRIMARY));
assertThat(vec.getChannel(SimpleRatingPredictor.PREDICTION_SOURCE_SYMBOL).get(3),
equalTo(ScoreSource.BASELINE));
}