### Question:
MappedBuffer extends ByteBufferBuffer { public void delete() { ((MappedBytes) bytes).delete(); } protected  MappedBuffer(MappedBytes bytes, int offset, int initialCapacity, int maxCapacity); static MappedBuffer allocate(File file); static MappedBuffer allocate(File file, FileChannel.MapMode mode); static MappedBuffer allocate(File file, int capacity); static MappedBuffer allocate(File file, FileChannel.MapMode mode, int capacity); static MappedBuffer allocate(File file, int initialCapacity, int maxCapacity); static MappedBuffer allocate(File file, FileChannel.MapMode mode, int initialCapacity, int maxCapacity); @Override MappedBuffer duplicate(); void delete();  }### Answer:
@Test public void testDelete() { File file = FileTesting.createFile(); MappedBuffer buffer = MappedBuffer.allocate(file, 16); buffer.writeLong(10).writeLong(11).flip(); assertEquals(10, buffer.readLong()); assertEquals(11, buffer.readLong()); assertTrue(Files.exists(file.toPath())); buffer.delete(); assertFalse(Files.exists(file.toPath())); }