@Test
    public void testConvertTo32BitField() {
        Set<Byte> bytes = mkSet((byte) 0, (byte) 1, (byte) 5, (byte) 10, (byte) 31);
        int bitField = Utils.to32BitField(bytes);
        assertEquals(bytes, Utils.from32BitField(bitField));

        bytes = new HashSet<>();
        bitField = Utils.to32BitField(bytes);
        assertEquals(bytes, Utils.from32BitField(bitField));

        assertThrows(IllegalArgumentException.class, () -> Utils.to32BitField(mkSet((byte) 0, (byte) 11, (byte) 32)));
    }
Expectation setter for multiple reads where each one reads random bytes to the buffer.

@param channelMock           The mocked FileChannel object
@param bufferSize            The buffer size
@return Expected buffer string
@throws IOException          If an I/O error occurs
clients/src/test/java/org/apache/kafka/common/utils/UtilsTest.java