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