public Builder addUpgrades(
          int index, org.bwapi.proxy.messages.GameMessages.UpgradeTypeData value) {
        if (upgradesBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          ensureUpgradesIsMutable();
          upgrades_.add(index, value);
          onChanged();
        } else {
          upgradesBuilder_.addMessage(index, value);
        }
        return this;
      }