private static Map getRankMap(Object[] params){
        if (params == null) {
            return null;
        }
        HashMap result = new HashMap();
        for (int i = 0; i < params.length; i++) {
            String name = params[i] instanceof Parameter ?
                ((Parameter) params[i]).name() :
                ((TypeVariable) params[i]).typeName();
            result.put(name, String.valueOf(i));
        }
        return result;
    }