### Question:
FileBuffer extends AbstractBuffer { public static FileBuffer allocate(File file) { return allocate(file, FileBytes.DEFAULT_MODE, DEFAULT_INITIAL_CAPACITY, Integer.MAX_VALUE); } private  FileBuffer(FileBytes bytes, int offset, int initialCapacity, int maxCapacity); static FileBuffer allocate(File file); static FileBuffer allocate(File file, int initialCapacity); static FileBuffer allocate(File file, int initialCapacity, int maxCapacity); static FileBuffer allocate(File file, String mode, int initialCapacity, int maxCapacity); File file(); MappedBuffer map(int size); MappedBuffer map(int size, FileChannel.MapMode mode); MappedBuffer map(int offset, int size); MappedBuffer map(int offset, int size, FileChannel.MapMode mode); @Override FileBuffer duplicate(); FileBuffer duplicate(String mode); void delete();  }### Answer:
@Test public void testFileToHeapBuffer() { File file = FileTesting.createFile(); try (FileBuffer buffer = FileBuffer.allocate(file, 16)) { buffer.writeLong(10).writeLong(11).flip(); byte[] bytes = new byte[16]; buffer.read(bytes).rewind(); HeapBuffer heapBuffer = HeapBuffer.wrap(bytes); assertEquals(buffer.readLong(), heapBuffer.readLong()); assertEquals(buffer.readLong(), heapBuffer.readLong()); } }
@Test public void testPersist() { File file = FileTesting.createFile(); try (FileBuffer buffer = FileBuffer.allocate(file, 16)) { buffer.writeLong(10).writeLong(11).flip(); assertEquals(10, buffer.readLong()); assertEquals(11, buffer.readLong()); } try (FileBuffer buffer = FileBuffer.allocate(file, 16)) { assertEquals(10, buffer.readLong()); assertEquals(11, buffer.readLong()); } }