private static Map<String, List<String>> groupFilesByName(Map<String, Long> map) {
    Map<String, List<String>> result = new HashMap<>();
    for (Map.Entry<String, Long> entry : map.entrySet()) {
      String path = entry.getKey();
      if (Digester.isFile(entry.getValue())) {
        String name = new File(path).getName();
        List<String> paths = result.get(name);
        if (paths == null) result.put(name, (paths = new LinkedList<>()));
        paths.add(path);
      }
    }
    return result;
  }
private static Map<String, List<String>> groupFilesByName(Map<String, Long> map)