@Test
public void convertToReference() {

    
    // given
    
    String destDocId = "doc_ABC";
    IdWithSimilarity idWithSimilarity = new IdWithSimilarity(destDocId, 13.4d);
    
    MatchableEntityData entityData = MatchableEntityData
                                            .newBuilder()
                                            .setRawText("RAW_TEXT")
                                            .setId("cit_QW1233_12")
                                            .build();
    MatchableEntity entity = new MatchableEntity(entityData);
    
    Tuple2<MatchableEntity, IdWithSimilarity> entityWithId = new Tuple2<>(entity, idWithSimilarity);
    
    
    // execute
    
    Tuple2<String, Reference> docIdReference = matchableEntityWithSimilarityConverter.convertToReference(entityWithId);
    
    
    // assert
    
    assertEquals(docIdReference._1(), "QW1233");
    assertEquals(docIdReference._2().getDocId(), "ABC");
    assertEquals(docIdReference._2().getRawText(), "RAW_TEXT");
    assertEquals(docIdReference._2().getRefNum(), 12);
}