private void assertContents(byte[] data, File file) throws IOException {
    assertEquals(data.length, file.getLength());

    InputStream is = file.getInputStream();

    if (data.length == 0) {
      assertEquals(-1, is.read());
      return;
    }

    byte[] results = new byte[data.length];
    assertEquals(file.getLength(), is.read(results));
    assertEquals(-1, is.read());
    is.close();

    assertArrayEquals(data, results);
  }
Test what happens a file rename is aborted in the middle due to the a cache closed exception.
The next member that uses those files should be able to clean up after the partial rename.
geode-lucene/src/test/java/org/apache/geode/cache/lucene/internal/filesystem/FileSystemJUnitTest.java