OffHeapByteBufferStore implements OffHeapStore { public byte[] remove(Pointer pointer) { return pointer.getOffHeapByteBuffer().remove(pointer); } OffHeapByteBufferStore(int capacity, int bufferSize);  OffHeapByteBufferStore(int capacity, int bufferSize, int concurrencyLevel); byte[] retrieve(Pointer pointer); byte[] remove(Pointer pointer); Pointer store(byte[] payload, long expiry); Pointer update(final Pointer pointer, final byte[] payload, final long expiry); long dirtyMemory(); long usedMemory(); long freeMemory(); void free(); void free(int bufferIndex);  }
@Test public void remove() { int size = 100; byte[] expectedBytes = new byte[size]; random.nextBytes(expectedBytes); doReturn(buffer).when(pointer).getOffHeapByteBuffer(); doReturn(expectedBytes).when(buffer).remove(pointer); byte[] actualBytes = bufferStore.remove(pointer); assertEquals(expectedBytes, actualBytes); }