@Test
  public void testCloseBeforeEnd() throws IOException, InterruptedException {
    writeFile(
        new Path(shardPath.getParent(), "data-000.json"), ImmutableList.of(RECORD_0, RECORD_1));

    assertTrue(recordReader.nextKeyValue());
    assertEquals(new LongWritable(0), recordReader.getCurrentKey());
    assertEquals(jsonParser.parse(RECORD_0), recordReader.getCurrentValue());

    recordReader.close();
  }
 @After
 public void tearDown() throws IOException {
   // Delete everything in basePath.
   fileSystem.delete(basePath, true);
   recordReader.close();
 }