@Override
    public int compareTo(NamespaceMetaData o) {
        if (o == null) {
            return -1;
        }
        if (this.equals(o)) {
            return 0;
        }
        int result = 0;
        if (name != null && o.name != null) {
            result = name.compareTo(o.name);
        } else if (name == null && o.name == null) {
            result = 0;
        } else if (name == null) {
            return -1;
        } else {
            return 1;
        }
        Iterator<String> thisIterable = extensionMap.keySet().iterator();
        Iterator<String> oIterable = o.extensionMap.keySet().iterator();
        while (result == 0) {
            if (thisIterable.hasNext() && oIterable.hasNext()) {
                result = thisIterable.next().compareTo(oIterable.next());
            } else if (!thisIterable.hasNext() && !oIterable.hasNext()) {
                result = 0;
            } else if (!thisIterable.hasNext()) {
                return -1;
            } else {
                return 1;
            }
        }
        return result;
    }
POJO for holding extension meta data
modules/siddhi-doc-gen/src/main/java/io/siddhi/doc/gen/metadata/NamespaceMetaData.java