CoansysInputDocumentConverter implements InputDocumentConverter<String, DocumentWrapper>, Serializable { @Override public JavaPairRDD<String, MatchableEntity> convertDocuments(JavaPairRDD<String, DocumentWrapper> inputDocuments) { Preconditions.checkNotNull(inputDocuments); return inputDocuments.mapToPair(doc-> convertToMatchableEntity(doc._2())); }  @Override JavaPairRDD<String, MatchableEntity> convertDocuments(JavaPairRDD<String, DocumentWrapper> inputDocuments); void setDocumentToMatchableEntityConverter(DocumentMetadataToEntityConverter documentToMatchableEntityConverter);  }
@Test(expectedExceptions=NullPointerException.class) public void convertDocuments_null() { coansysInputDocumentConverter.convertDocuments(null); }
@Test public void convertDocuments() throws Exception { Mockito.doReturn(matchableEntities).when(inputDocuments).mapToPair(Mockito.any()); JavaPairRDD<String, MatchableEntity> retEntities = coansysInputDocumentConverter.convertDocuments(inputDocuments); assertTrue(retEntities == matchableEntities); verify(inputDocuments).mapToPair(convertToMatchableEntityFunction.capture()); assertConvertToMatchableEntityFunction(convertToMatchableEntityFunction.getValue()); }