static boolean exceptionClassesAndMessagesMatch(Throwable a, Throwable b) {
        if (a == null) return b == null;
        if (b == null) return false;
        if (!a.getClass().equals(b.getClass())) return false;
        return Objects.equals(a.getMessage(), b.getMessage());
    }
Returns true if the class and message fields match for two exceptions. Handles nulls.
metadata/src/main/java/org/apache/kafka/controller/errors/EventHandlerExceptionInfo.java