public static boolean isValidModuleName(@NotNull String name, @NotNull PsiElement context) {
    PsiNameHelper helper = getInstance(context.getProject());
    LanguageLevel level = PsiUtil.getLanguageLevel(context);
    return StringUtil.split(name, ".", true, false).stream().allMatch(part -> helper.isIdentifier(part, level));
  }
public static boolean isValidModuleName(@NotNull String name, @NotNull PsiElement context)