private static int countFiles(List<? extends PsiFileSystemItem> elements) {
    int fileCount = 0;
    for (PsiFileSystemItem child : elements) {
      fileCount += countFiles(child);
    }
    return fileCount;
  }
private static int countFiles(List<? extends PsiFileSystemItem> elements)