private static int countFiles(PsiFileSystemItem element) {
    if (element instanceof PsiDirectory) {
      return countFiles(ContainerUtil.filterIsInstance(element.getChildren(), PsiFileSystemItem.class));
    }
    return 1;
  }
private static int countFiles(PsiFileSystemItem element)