@Override
        public int compare(Map.Entry<String, Node> a, Map.Entry<String, Node> b) {
            SourceLocation left = a.getValue().getSourceLocation();
            SourceLocation right = b.getValue().getSourceLocation();
            int comparison = left.compareTo(right);
            return comparison != 0 ? comparison : a.getKey().compareTo(b.getKey());
        }
Reorganizes shapes based on a preferred ordering of shapes, and alphanumeric traits and metadata.

<p>Shapes are ordered as follows:

<ul>
    <li>Trait definitions</li>
    <li>Services</li>
    <li>Resources</li>
    <li>Operations</li>
    <li>Structures</li>
    <li>Unions</li>
    <li>Lists</li>
    <li>Maps</li>
    <li>Finally, alphabetically by shape type.</li>
</ul>
smithy-model/src/main/java/software/amazon/smithy/model/shapes/SmithyIdlComponentOrder.java