@Test
  public void testOpenDirectoryStreamsClosed() throws IOException {
    Path p = fs.getPath("/foo");
    Files.createDirectory(p);

    try (DirectoryStream<Path> stream = Files.newDirectoryStream(p)) {

      fs.close();

      try {
        stream.iterator();
        fail();
      } catch (ClosedDirectoryStreamException expected) {
      }
    }
  }
Tests for what happens when a file system is closed.

@author Colin Decker
jimfs/src/test/java/com/google/common/jimfs/JimfsFileSystemCloseTest.java