title: Should Guava Splitters/Joiners be created each time they are used?
body: <p>Guava contains utilities for splitting and joining Strings, but it requires the instantiation of a Splitter/Joiner object to do so.  These are small objects that typically only contain the character(s) on which to split/join.  Is it a good idea to maintain references to these objects in order to reuse them, or is it preferable to just create them whenever you need them and let them be garbage collected?</p>
  
  <p>For example, I could implement this method in the following two ways:</p>
  
  <pre><code>String joinLines(List&lt;String&gt; lines) {
    return Joiner.on("\n").join(lines);
  }
  </code></pre>
  
  <p>OR</p>
  
  <pre><code>static final Joiner LINE_JOINER = Joiner.on("\n");
  
  String joinLines(List&lt;String&gt; lines) {
    return LINE_JOINER.join(lines);
  }
  </code></pre>
  
  <p>I find the first way more readable, but it seems wasteful to create a new Joiner each time the method is called.</p>