@Test
    public void testIterationDoesntChangePosition() throws IOException {
        long position = fileRecords.channel().position();
        Iterator<Record> records = fileRecords.records().iterator();
        for (byte[] value : values) {
            assertTrue(records.hasNext());
            assertEquals(records.next().value(), ByteBuffer.wrap(value));
        }
        assertEquals(position, fileRecords.channel().position());
    }
Iterating over the file does file reads but shouldn't change the position of the underlying FileChannel.
clients/src/test/java/org/apache/kafka/common/record/FileRecordsTest.java