public void checkOpen() {
    if (!open.get()) {
      throw new ClosedFileSystemException();
    }
  }
@Test
  public void testCheckOpen() throws IOException {
    state.checkOpen(); // does not throw
    state.close();
    try {
      state.checkOpen();
      fail();
    } catch (ClosedFileSystemException expected) {
    }
  }