public static void assertTableRecords(Table table, List<Record> expected, String branch)
            throws IOException {
        table.refresh();
        Snapshot snapshot = latestSnapshot(table, branch);

        if (snapshot == null) {
            Assert.assertEquals(expected, ImmutableList.of());
            return;
        }

        Types.StructType type = table.schema().asStruct();
        StructLikeSet expectedSet = StructLikeSet.create(type);
        expectedSet.addAll(expected);

        try (CloseableIterable<Record> iterable =
                IcebergGenerics.read(table).useSnapshot(snapshot.snapshotId()).build()) {
            StructLikeSet actualSet = StructLikeSet.create(type);

            for (Record record : iterable) {
                actualSet.add(record);
            }

            Assert.assertEquals("Should produce the expected record", expectedSet, actualSet);
        }
    }
Assert table contains the expected list of records after waiting up to {@code maxCheckCount}
with {@code checkInterval}
inlong-sort/sort-flink/sort-flink-v1.13/sort-connectors/iceberg/src/test/java/org/apache/inlong/sort/iceberg/sink/util/SimpleDataUtil.java