@Override
        public void write(ByteBuffer buffer, Object o) {
            if (o == null) {
                COMPACT_NULLABLE_BYTES.write(buffer, null);
            } else if (o instanceof MemoryRecords) {
                MemoryRecords records = (MemoryRecords) o;
                COMPACT_NULLABLE_BYTES.write(buffer, records.buffer().duplicate());
            } else {
                throw new IllegalArgumentException("Unexpected record type: " + o.getClass());
            }
        }
The Boolean type represents a boolean value in a byte by using
the value of 0 to represent false, and 1 to represent true.

If for some reason a value that is not 0 or 1 is read,
then any non-zero value will return true.
clients/src/main/java/org/apache/kafka/common/protocol/types/Type.java