@Override
    public int totalSize() {
        return payload != null ? payload.length : 0;
    }
@Test
    public void totalSize_whenNonEmpty() {
        HeapData heapData = new HeapData(new byte[10]);
        assertEquals(10, heapData.totalSize());
    }