@SuppressWarnings("unchecked")
    public static int compare(Object obj1, Object obj2) {
        if (obj1 instanceof Comparable && obj1.getClass().equals(obj2.getClass())) {
            return ((Comparable) obj1).compareTo(obj2);
        } else {
            return obj1.toString().compareTo(obj2.toString());
        }
    }
Compares two comparable objects.

@return The value {@code 0} if {@code num1} is equal to the {@code num2}; a value less than
    {@code 0} if the {@code num1} is numerically less than the {@code num2}; and a value
    greater than {@code 0} if the {@code num1} is numerically greater than the {@code num2}.
@throws ClassCastException if the compared objects are not instance of {@link Comparable} or
    not <i>mutually comparable</i> (for example, strings and integers).
inlong-sort/sort-flink/sort-flink-v1.13/sort-connectors/mysql-cdc/src/main/java/org/apache/inlong/sort/cdc/mysql/source/utils/ObjectUtils.java