### Question:
FileSystemState implements Closeable { public void checkOpen() { if (!open.get()) { throw new ClosedFileSystemException(); } } FileSystemState(Runnable onClose); boolean isOpen(); void checkOpen(); C register(C resource); void unregister(Closeable resource); @Override void close();  }### Answer:
@Test public void testCheckOpen() throws IOException { state.checkOpen(); state.close(); try { state.checkOpen(); fail(); } catch (ClosedFileSystemException expected) { } }