private static Schema inferListSchema(List<?> list) {
        if (list.isEmpty()) {
            return null;
        }
        SchemaDetector detector = new SchemaDetector();
        for (Object element : list) {
            if (!detector.canDetect(element)) {
                return null;
            }
        }
        return SchemaBuilder.array(detector.schema()).build();
    }
If possible infer a schema for the given value.

@param value the value whose schema is to be inferred; may be null
@return the inferred schema, or null if the value is null or no schema could be inferred
connect/api/src/main/java/org/apache/kafka/connect/data/Values.java