@Test
public void convertMatchedCitations() throws Exception {

    
    // given
    
    doReturn(matchedReferences).when(matchedCitations).mapToPair(Mockito.any());
    doReturn(docIdReferences).when(matchedReferences).groupByKey();
    doReturn(docIdWithPicOut).when(docIdReferences).mapToPair(Mockito.any());
    
    
    // execute
    
    JavaPairRDD<String, PicOut> retDocIdWithPicOut = coansysOutputConverter.convertMatchedCitations(matchedCitations);
    
    
    // assert
    
    assertTrue(docIdWithPicOut == retDocIdWithPicOut);
    
    verify(matchedCitations).mapToPair(convertToReferenceFunction.capture());
    assertConvertToReferenceFunction(convertToReferenceFunction.getValue());
    
    verify(docIdReferences).mapToPair(convertToPicOutFunction.capture());
    assertConvertToPicOutFunction(convertToPicOutFunction.getValue());
    
}