code: public synchronized void setUserAgent(String applicationName,
              String applicationVersion, String programmingLanguage,
              String... additionalNameValuePairs) {
          checkUpdatable();
          StringBuilder b = new StringBuilder();
          b.append(applicationName);
          b.append("/");
          b.append(applicationVersion);
          b.append(" (Language=");
          b.append(programmingLanguage);
          int i = 0;
          while (i < additionalNameValuePairs.length) {
              String name = additionalNameValuePairs[i];
              String value = additionalNameValuePairs[i + 1];
              b.append("; ");
              b.append(name);
              b.append("=");
              b.append(value);
              i += 2;
          }
          b.append(")");
          this.userAgent = b.toString();
      }
docs: Sets UserAgent property
  
  @param applicationName
  @param applicationVersion
  @param programmingLanguage
  @param additionalNameValuePairs