private void verifyFileContents(final Function<RemoteLogSegmentMetadata, InputStream> actual,
                                        final RemoteLogSegmentId id,
                                        final byte[] expected) {
            try {
                final InputStream in = actual.apply(newMetadata(id));
                assertArrayEquals(expected, readFully(in));
            } catch (RemoteStorageException | IOException e) {
                throw new AssertionError(e);
            }
        }
Verifies the content of the remote producer snapshot matches with the {@code expected} array.

@param id The unique ID of the remote log segment and associated resources (e.g. offset and time indexes).
@param expected The expected content.
storage/src/test/java/org/apache/kafka/server/log/remote/storage/LocalTieredStorageTest.java