@Override
    public int compareTo(ValidationEvent other) {
        int comparison = getSourceLocation().getFilename().compareTo(other.getSourceLocation().getFilename());
        if (comparison != 0) {
            return comparison;
        }

        comparison = Integer.compare(getSourceLocation().getLine(), other.getSourceLocation().getLine());
        if (comparison != 0) {
            return comparison;
        }

        comparison = Integer.compare(getSourceLocation().getColumn(), other.getSourceLocation().getColumn());
        if (comparison != 0) {
            return comparison;
        }

        // Fall back to a comparison that favors by severity, followed, by shape ID, etc...
        return toString().compareTo(other.toString());
    }
Creates a new ValidationEvent from a {@link SourceException}.

@param exception Exception to use to create the event.
@param prefix Prefix string to add to the message.
@param shapeId ShapeId to associate with the event.
@return Returns a created validation event with an ID of Model.
smithy-model/src/main/java/software/amazon/smithy/model/validation/ValidationEvent.java