public static void checkCanCreateClass(@NotNull PsiDirectory directory, String name) {
    PsiDirectory currentDir = directory;
    String packageName = StringUtil.getPackageName(name);
    if (!packageName.isEmpty()) {
      for (String dir : packageName.split("\\.")) {
        PsiDirectory childDir = currentDir.findSubdirectory(dir);
        if (childDir == null) {
          return;
        }
        currentDir = childDir;
      }
    }
    JavaDirectoryService.getInstance().checkCreateClass(currentDir, StringUtil.getShortName(name));
  }
public static void checkCanCreateClass(@NotNull PsiDirectory directory, String name)