code: static String getShortNameForRequire(String namespace) {
      int lastDot = namespace.lastIndexOf('.');
      if (lastDot == -1) {
        return namespace;
      }
  
      // A few special cases so that we don't end up with code like
      // "const string = goog.require('goog.string');" which would shadow the built-in string type.
      String rightmostName = namespace.substring(lastDot + 1);
      switch (Ascii.toUpperCase(rightmostName)) {
        case "ARRAY":
        case "MAP":
        case "MATH":
        case "OBJECT":
        case "PROMISE":
        case "SET":
        case "STRING":
          int secondToLastDot = namespace.lastIndexOf('.', lastDot - 1);
          String secondToLastName = namespace.substring(secondToLastDot + 1, lastDot);
          boolean capitalize = Character.isUpperCase(rightmostName.charAt(0));
          if (capitalize) {
            secondToLastName = upperCaseFirstLetter(secondToLastName);
          }
          return secondToLastName + upperCaseFirstLetter(rightmostName);
        default:
          return rightmostName;
      }
    }
docs: TODO(bangert): Find a non-conflicting name.