@Test
    public void testToLogDateTimeFormat() {
        final LocalDateTime timestampWithMilliSeconds = LocalDateTime.of(2020, 11, 9, 12, 34, 5, 123000000);
        final LocalDateTime timestampWithSeconds = LocalDateTime.of(2020, 11, 9, 12, 34, 5);

        DateTimeFormatter offsetFormatter = DateTimeFormatter.ofPattern("XXX");
        ZoneOffset offset = ZoneId.systemDefault().getRules().getOffset(timestampWithSeconds);
        String requiredOffsetFormat = offsetFormatter.format(offset);

        assertEquals(String.format("2020-11-09 12:34:05,123 %s", requiredOffsetFormat), Utils.toLogDateTimeFormat(timestampWithMilliSeconds.atZone(ZoneId.systemDefault()).toInstant().toEpochMilli()));
        assertEquals(String.format("2020-11-09 12:34:05,000 %s", requiredOffsetFormat), Utils.toLogDateTimeFormat(timestampWithSeconds.atZone(ZoneId.systemDefault()).toInstant().toEpochMilli()));
    }
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