@Override
    public boolean equals(Object o) {
        if (o == null || !(o.getClass().equals(EventHandlerExceptionInfo.class))) return false;
        EventHandlerExceptionInfo other = (EventHandlerExceptionInfo) o;
        return isFault == other.isFault &&
                causesFailover == other.causesFailover &&
                exceptionClassesAndMessagesMatch(internalException, other.internalException) &&
                exceptionClassesAndMessagesMatch(externalException.orElse(null),
                        other.externalException.orElse(null));
    }
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