### Question:
PersistenceRDD { private void checkResult(List<?> collect) { for (Object o : collect) { System.out.println(o.toString()); } }  void testReadFile(); void testParallelize();  }### Answer:
@Test public void testReadFile() throws Exception { JavaRDD<String> stringJavaRDD = sparkContext.textFile(FILE_PATH); List<String> collect = stringJavaRDD.collect(); checkResult(collect); }
@Test public void testParallelize() { List<String> stringList = Arrays.asList("1", "2", "3", "4", "5"); JavaRDD<String> parallelize = sparkContext.parallelize(stringList); List<String> collect = parallelize.collect(); checkResult(collect); }