title: What's the best way to trim() all elements in a List<String>?
body: <p>I have a <code>List&lt;String&gt;</code>, potentially holding thousands of strings.  I am implementing a validation method, which includes ensuring that there aren't any leading or trailing whitespaces in each string.</p>
  
  <p>I'm currently iterating over the list, calling <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html#trim--" rel="noreferrer">String.trim()</a> for each <code>String</code>, and adding it to a new <code>List&lt;String&gt;</code> and reassigning back to the original list after:</p>
  
  <pre><code>List&lt;String&gt; trimmedStrings = new ArrayList&lt;String)();
  for(String s : originalStrings) {
    trimmedStrings.add(s.trim());
  }
  
  originalStrings = trimmedStrings;
  </code></pre>
  
  <p>I feel like there's a <a href="https://en.wikipedia.org/wiki/Don%27t_repeat_yourself" rel="noreferrer">DRYer</a> way to do this.  Are there alternate, more efficient approaches here? Thanks!</p>
  
  <p>Edit:  Yes I am on Java 8, so Java 8 suggestions are welcome!</p>