title: java.lang.ClassCastException: [Ljava.lang.String; cannot be cast to java.lang.String
body: <p>I'm having that error. This is my code:</p>
  
  <pre><code>GmailSettingsService service = new GmailSettingsService(APPLICATION_NAME, DOMAIN_NAME, null, null){
          @Override
          public void setUserCredentials(String username, String password)
                  throws AuthenticationException {
              // Nothing to do here, just Overriding the old method and setting it to null so we can later setOauthCredentials to the service
          }};
  
      service.setOAuth2Credentials(credential);
      List users = new ArrayList();
      for (int i = 0; i &lt; emailsData.size(); i++)
      {
          users.add(emailsData.get(0).get(i).split("@"));
  
          String signature = "some html code";
          String escaped = StringEscapeUtils.escapeHtml4(signature).toString();
  
          service.changeSignature(users, escaped);
  
          users.remove(0);
      }
  </code></pre>
  
  <p>The IDE sends me to the <code>service.changeSignature(users, escaped);</code> with the next exception:</p>
  
  <pre><code>Exception in thread "main" java.lang.ClassCastException: [Ljava.lang.String; cannot be cast to java.lang.String
  at gmailsettings.GmailSettingsService.changeSignature(GmailSettingsService.java:723)
  at Controller.updateSignature(Controller.java:306)
  at Controller.main(Controller.java:126)
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  at java.lang.reflect.Method.invoke(Method.java:497)
  at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)
  </code></pre>
  
  <p>Any solution? The program crashes where it's supposed to transform html code to encoded String and update a Gmail signature with that encoded String</p>