public long residentMemorySizeEstimate() {
        long size = 0;
        size += Long.BYTES; // value.context.timestamp
        size += Long.BYTES; // value.context.offset
        if (topic != null) {
            size += topic.toCharArray().length;
        }
        size += Integer.BYTES; // partition
        for (final Header header : headers) {
            size += header.key().toCharArray().length;
            final byte[] value = header.value();
            if (value != null) {
                size += value.length;
            }
        }
        return size;
    }
@Test
    public void shouldEstimateHeadersLength() {
        final Headers headers = new RecordHeaders();
        headers.add("header-key", "header-value".getBytes());
        final ProcessorRecordContext context = new ProcessorRecordContext(
            42L,
            73L,
            0,
            null,
            headers
        );

        assertEquals(MIN_SIZE + 10L + 12L, context.residentMemorySizeEstimate());
    }