CitationOutputConverter implements OutputConverter<Citation, NullWritable>, Serializable { @Override public JavaPairRDD<Citation, NullWritable> convertMatchedCitations( JavaPairRDD<MatchableEntity, IdWithSimilarity> matchedCitations) { JavaPairRDD<Citation, NullWritable> convertedMatchedCitations = matchedCitations .mapToPair(x -> new Tuple2<>(converter.convertToCitation(x._1, x._2), NullWritable.get())); return convertedMatchedCitations; }  @Override JavaPairRDD<Citation, NullWritable> convertMatchedCitations(
            JavaPairRDD<MatchableEntity, IdWithSimilarity> matchedCitations); void setConverter(MatchedCitationToCitationConverter converter);  }
@Test public void convertMatchedCitations() throws Exception { doReturn(convertedMatchedCitations).when(matchedCitations).mapToPair(any()); JavaPairRDD<Citation, NullWritable> retConvertedMatchedCitations = citationOutputConverter.convertMatchedCitations(matchedCitations); assertTrue(retConvertedMatchedCitations == convertedMatchedCitations); verify(matchedCitations).mapToPair(convertMatchedCitationFunction.capture()); assertConvertMatchedCitationFunction(convertMatchedCitationFunction.getValue()); }