title: Create an Array from existing array with additional element added
body: <p>I have a method that takes vararg Array of strings</p>
  
  <pre><code>void count(long delta, String... tags);
  </code></pre>
  
  <p>I have a predefined array of tags for the most cases </p>
  
  <pre><code>String[] tags = { "foo_tag:Foo",
                    "bar_tag:Bar",
                    "baz_tag:Baz"
                  };
  </code></pre>
  
  <p>and only one tag to be added to predefined tags in each call <code>"project_id:12345"</code></p>
  
  <p>So the call of count should look like this:</p>
  
  <pre><code>count(delta, "foo_tag:Foo", "bar_tag:Bar", "baz_tag:Baz", "project_id:12345");
  </code></pre>
  
  <p>How can I simply create a new array containing my existing one plus additional element just in place of calling the method?</p>
  
  <p>Something like this hypothetical <code>Arrays.append</code> method:</p>
  
  <pre><code>count(delta, Arrays.append(tags, "project_id:12345"));
  </code></pre>
  
  <p>This is storing statistics operation, not a business logic, so I want this operation to be as fast as possible.<br>
  Currently, I have helper method appendTag, but it doesn't look elegant as for me</p>
  
  <pre><code>private String[] appendTag(String[] tags, String s)
  {
      String[] result = new String[tags.length + 1];
      System.arraycopy(tags, 0, result, 0, tags.length);
      result[result.length-1] = s;
      return result;
  }
  </code></pre>