private void doFillPatternBasic(final int chunkSize) {
    /*
     * Pull a chunk off the fragment. This will have no fill because it is a "fresh" chunk.
     */
    OffHeapStoredObject chunk1 = (OffHeapStoredObject) allocator.allocate(chunkSize);

    /*
     * Chunk should have valid fill from initial fragment allocation.
     */
    chunk1.validateFill();

    // "Dirty" the chunk so the release has something to fill over
    chunk1.writeDataBytes(OffHeapStoredObject.MIN_CHUNK_SIZE + 1, WRITE_BYTES);

    // This should free the Chunk (ref count == 1)
    chunk1.release();

    /*
     * This chunk should have a fill because it was reused from the free list (assuming no
     * fragmentation at this point...)
     */
    OffHeapStoredObject chunk = (OffHeapStoredObject) allocator.allocate(chunkSize);

    // Make sure we have a fill this time
    chunk.validateFill();

    // Give the fill code something to write over during the release
    chunk.writeDataBytes(OffHeapStoredObject.MIN_CHUNK_SIZE + 1, WRITE_BYTES);
    chunk.release();

    // Again, make sure the release implemented the fill
    chunk.validateFill();

    // "Dirty up" the free chunk
    chunk.writeDataBytes(OffHeapStoredObject.MIN_CHUNK_SIZE + 1, WRITE_BYTES);

    Throwable thrown = catchThrowable(chunk::validateFill);
    assertTrue(thrown instanceof IllegalStateException);
    assertEquals(
        "Fill pattern violated for chunk " + chunk.getAddress() + " with size " + chunk.getSize(),
        thrown.getMessage());

  }
This tests the fill pattern for a single huge Chunk allocation.
geode-core/src/test/java/org/apache/geode/internal/offheap/MemoryAllocatorFillPatternJUnitTest.java