code: private ImmutableSortedMap<Integer, String> assembleParamNames(Node paramList, int maxCount) {
      checkArgument(paramList.isParamList(), paramList);
  
      ImmutableSortedMap.Builder<Integer, String> builder = ImmutableSortedMap.naturalOrder();
      int index = 0;
  
      // Collect all existing param names first...
      for (Node param = paramList.getFirstChild(); param != null; param = param.getNext()) {
        switch (param.getToken()) {
          case NAME:
            builder.put(index, param.getString());
            break;
  
          case REST:
            return builder.build();
  
          case DEFAULT_VALUE:
            // `arguments` doesn't consider default values. It holds exactly the provided args.
          case OBJECT_PATTERN:
          case ARRAY_PATTERN:
            // Patterns have no names to substitute into the body.
            break;
  
          default:
            throw new IllegalArgumentException(param.toString());
        }
  
        index++;
      }
      // ... then synthesize any additional param names.
      for (; index < maxCount; index++) {
        builder.put(index, paramPrefix + uniqueId++);
      }
  
      return builder.build();
    }
docs: Generates a {@link Map} from argument indices to parameter names.
  
  <p>A {@link Map} is used because the sequence may be sparse in the case that there is an
  anonymous param, such as a destructuring param. There may also be fewer returned names than
  {@code maxCount} if there is a rest param, since no additional params may be synthesized.
  
  @param maxCount The maximum number of argument names in the returned map.