@NotNull
  public static String convertModuleName(@NotNull String name) { // "public" is for testing
    // All non-alphanumeric characters ([^A-Za-z0-9]) are replaced with a dot (".") ...
    name = NON_NAME.matcher(name).replaceAll(".");
    // ... all repeating dots are replaced with one dot ...
    name = DOT_SEQUENCE.matcher(name).replaceAll(".");
    // ... and all leading and trailing dots are removed.
    name = StringUtil.trimLeading(StringUtil.trimTrailing(name, '.'), '.');

    // sanitize keywords and leading digits
    String[] parts = name.split("\\.");
    StringBuilder builder = new StringBuilder();
    boolean first = true;
    for (String part : parts) {
      if (part.isEmpty()) {
        continue;
      }
      if (Character.isJavaIdentifierStart(part.charAt(0))) {
        if (!first) {
          builder.append('.');
        }
        builder.append(part);
        if (PsiUtil.isKeyword(part, LanguageLevel.JDK_1_9)) {
          builder.append('x');
        }
      }
      else { // it's a leading digit
        if (first) {
          builder.append("module");
        }
        builder.append(part);
      }
      first = false;
    }
    return builder.toString();
  }
@NotNull
  public static String convertModuleName(@NotNull String name)