DefaultInputReader implements InputCitationReader<String, MatchableEntity>, InputDocumentReader<String, MatchableEntity> { @Override public JavaPairRDD<String, MatchableEntity> readDocuments(JavaSparkContext sparkContext, String inputDocumentPath) { return readEntities(sparkContext, inputDocumentPath); }  @Override JavaPairRDD<String, MatchableEntity> readDocuments(JavaSparkContext sparkContext, String inputDocumentPath); @Override JavaPairRDD<String, MatchableEntity> readCitations(JavaSparkContext sparkContext, String inputCitationPath);  }
@Test public void readDocuments() throws Exception { doReturn(documentsWritable).when(sparkContext).sequenceFile("/path/to/documents/", Text.class, BytesWritable.class); doReturn(documents).when(documentsWritable).mapToPair(any()); JavaPairRDD<String, MatchableEntity> retDocuments = inputReader.readDocuments(sparkContext, "/path/to/documents/"); assertTrue(retDocuments == documents); verify(sparkContext).sequenceFile("/path/to/documents/", Text.class, BytesWritable.class); verify(documentsWritable).mapToPair(mapToEntityFunction.capture()); assertMapToEntityFunction(mapToEntityFunction.getValue()); }