@Override
        public int compare(Extension extA, Extension extB) {

            int priorityA = extensionPriority.getOrDefault(extA.getNamespace(), defaultPriority);
            int priorityB = extensionPriority.getOrDefault(extB.getNamespace(), defaultPriority);

            // Sort by explicit priority first
            if (priorityA != priorityB)
                return priorityA - priorityB;

            // Sort all extensions without explicit priorities by their
            // filenames (no extensions will have the same priority except
            // those that aren't explicitly listed)
            return extA.getFile().compareTo(extB.getFile());

        }
Creates a new ExtensionComparator that ensures each of the given
extensions are sorted in the relative order listed, with any
extensions not explicitly listed sorted by filename.

@param name
    The name of the property defining the provided list of
    extensions.

@param extensions
    The namespaces of the extensions in the order they should be
    sorted, with the special value "*" functioning as a
    placeholder for all extensions that are not explicitly listed.
guacamole/src/main/java/org/apache/guacamole/extension/ExtensionOrderProperty.java