### Question:
LockedFileChannel implements Closeable { public void close() throws IOException { if (lock.isHeldByCurrentThread()) { throw new IllegalMonitorStateException(); } raf.close(); ungetLock(file); } LockedFileChannel(File file, Mode mode); File getFile(); FileChannel getChannel(); void lock(); void unlock(); void close(); boolean isHeldByCurrentThread();  }### Answer:
@Test public void testClose() throws Exception { LockedFileChannel lfc = create(Mode.r); Channel c = lfc.getChannel(); assertTrue(c.isOpen()); lfc.close(); assertFalse(c.isOpen()); }