public String findNamespace(String namespace) {
        Map<String, List<String>> allNamespaces = new LinkedHashMap<String, List<String>>();
        for (String n : getNamespaces()) {
            allNamespaces.put(n, new ArrayList<String>(Arrays.asList(n.split(":"))));
        }

        List<String> found = new ArrayList<String>();
        int i = 0;
        for (String part : namespace.split(":")) {
        	Set<String> filteredNamespaces = new LinkedHashSet<String>();

        	for (List<String> subNamespaces : allNamespaces.values()) {
        		if (i < subNamespaces.size()) {
        			filteredNamespaces.add(subNamespaces.get(i));
        		}
        	}

        	Map<String, List<String>> abbrevs = getAbbreviations(new ArrayList<String>(filteredNamespaces));

            if (!abbrevs.containsKey(part)) {
            	StringBuilder message = new StringBuilder();
                message.append(String.format("There are no commands defined in the \"%s\" namespace.", namespace));

                if (1 <= i) {
                    part = String.format("%s:%s", join(found, ':'), part);
                }

                Set<String> alternatives = findAlternativeNamespace(part, abbrevs);

                if (!alternatives.isEmpty()) {
                    if (1 == alternatives.size()) {
                        message.append("\n\nDid you mean this?\n    ");
                    } else {
                        message.append("\n\nDid you mean one of these?\n    ");
                    }

                    message.append(join(alternatives, "\n    "));
                }

                throw new IllegalArgumentException(message.toString());
            }

            if (abbrevs.get(part).size() > 1) {
                String abbreviationSuggestions = getAbbreviationSuggestions(abbrevs.get(part));

                throw new IllegalArgumentException(String.format("The namespace \"%s\" is ambiguous (%s).", namespace, abbreviationSuggestions));
            }

            found.add(abbrevs.get(part).get(0));
            i++;
        }

        return join(found, ':');
    }