public void testDeletedStoreRemainsUsableWhileOpen() throws IOException {
      byte[] bytes = bytes("1234567890");
      file.write(0, bytes, 0, bytes.length);

      file.opened();
      file.opened();

      file.deleted();

      assertContentEquals(bytes, file);

      byte[] moreBytes = bytes("1234");
      file.write(bytes.length, moreBytes, 0, 4);

      byte[] totalBytes = concat(bytes, bytes("1234"));
      assertContentEquals(totalBytes, file);

      file.closed();

      assertContentEquals(totalBytes, file);

      file.closed();

      // don't check anything else; no guarantee of what if anything will happen once the file is
      // deleted and completely closed
    }
Actual test cases for testing RegularFiles.
jimfs/src/test/java/com/google/common/jimfs/RegularFileTest.java