public List<List<String>> groupStrings(String[] strings) {
        List<List<String>> res = new ArrayList<List<String>>();
        if (strings == null) return res;

        HashMap<String, List<String>> map = new HashMap<String, List<String>>();
        for (String s : strings) {
            String key = getKey(s);
            if (!map.containsKey(key)) map.put(key, new ArrayList<String>());
            map.get(key).add(s);
        }

        for (String k : map.keySet()) res.add(map.get(k));
        return res;
    }