@Test
public void pickBest() {

    
    
    // given
    
    JavaPairRDD<MatchableEntity, MatchableEntity> citDocPairs = sparkContext.parallelizePairs(ImmutableList.of(
            new Tuple2<>(citation1, document1),
            new Tuple2<>(citation1, document2),
            new Tuple2<>(citation1, document3),
            new Tuple2<>(citation2, document4),
            new Tuple2<>(citation4, document4),
            new Tuple2<>(citation4, document5)));
    
    
    
    // execute
    
    JavaPairRDD<MatchableEntity, IdWithSimilarity> actualMatchedCitations = bestMatchedCitationPicker.pickBest(citDocPairs);
    
    
    // assert
    
    List<Tuple2<MatchableEntity, IdWithSimilarity>> expectedMatchedCitations = ImmutableList.of(
            new Tuple2<>(citation1, new IdWithSimilarity(document2.id(), 0.748069)),
            new Tuple2<>(citation4, new IdWithSimilarity(document5.id(), 0.739753)));
    
    assertMatchedEquals(actualMatchedCitations.collect(), expectedMatchedCitations);
    
}