### Question:
SimilaritySumNeighborhoodScorer implements NeighborhoodScorer, Serializable { @Override public void score(long item, Long2DoubleMap neighbors, Long2DoubleMap scores, ItemItemScoreAccumulator accum) { if (neighbors.size() > 0) { double sum = Vectors.sum(neighbors); accum.add(item, sum, neighbors.size(), sum); } }  @Override void score(long item, Long2DoubleMap neighbors, Long2DoubleMap scores, ItemItemScoreAccumulator accum); @Override String toString();  }### Answer:
@Test public void testEmpty() { Long2DoubleMap nbrs = Long2DoubleMaps.EMPTY_MAP; Long2DoubleMap scores = Long2DoubleMaps.EMPTY_MAP; List<ItemItemResult> results = new ArrayList<>(); ItemItemScoreAccumulator accum = ItemItemScoreAccumulator.detailed(results); scorer.score(42, nbrs, scores, accum); assertThat(results, hasSize(0)); }
@Test public void testEmptyNbrs() { Long2DoubleMap nbrs = Long2DoubleMaps.EMPTY_MAP; Long2DoubleMap scores = Long2DoubleMaps.singleton(5, 3.7); List<ItemItemResult> results = new ArrayList<>(); ItemItemScoreAccumulator accum = ItemItemScoreAccumulator.detailed(results); scorer.score(42, nbrs, scores, accum); assertThat(results, hasSize(0)); }
@Test public void testOneNbr() { Long2DoubleMap nbrs = Long2DoubleMaps.singleton(5, 1.0); Long2DoubleMap scores = Long2DoubleMaps.singleton(5, 3.7); List<ItemItemResult> results = new ArrayList<>(); ItemItemScoreAccumulator accum = ItemItemScoreAccumulator.detailed(results); scorer.score(42, nbrs, scores, accum); assertThat(results, hasSize(1)); assertThat(results.get(0).getScore(), closeTo(1.0)); }
@Test public void testMultipleNeighbors() { Long2DoubleMap nbrs = new Long2DoubleOpenHashMap(); nbrs.put(2, 0.5); nbrs.put(5, 1.0); nbrs.put(7, 0.92); Long2DoubleMap scores = new Long2DoubleOpenHashMap(); scores.put(2, 3.7); scores.put(3, 4.2); scores.put(5, 1.2); scores.put(7, 7.8); List<ItemItemResult> results = new ArrayList<>(); ItemItemScoreAccumulator accum = ItemItemScoreAccumulator.detailed(results); scorer.score(42, nbrs, scores, accum); assertThat(results, hasSize(1)); assertThat(results.get(0).getScore(), closeTo(2.42)); }