private Map<String, String> parseVariablesForUri(final URI uri, final String[] routePaths) {
        Map<String, String> routeParams = null;
        Map<String, String> variables = new HashMap<String, String>();
        String[] inputPaths = URIUtils.getPathSegments(uri);

        boolean isComponentCountEqual = routePaths.length == inputPaths.length;
        if (isComponentCountEqual) {
            boolean isMatch = true;
            int routePathsSize = routePaths.length;
            for (int i = 0 ; i < routePathsSize ; i ++) {
                if (routePaths[i].startsWith(":")) {
                    variables.put(routePaths[i].substring(1), inputPaths[i]);
                } else if (!routePaths[i].equals(inputPaths[i])) {
                    isMatch = false;
                    break;
                }
            }
            if (isMatch) {
                routeParams = variables;
            }
        }

        return routeParams;
    }