title: How to return and clear a list?
body: <p>I've wondered if there is a more elegant approach to return an attribute and change/"reset" its value. This is the way I've been doing it by now:</p>
  
  <pre><code>[...]
  
  final List&lt;T&gt; copyOfOriginal = new ArrayList&lt;T&gt;(original);
  original.clear();
  
  return copyOfOriginal;
  
  [...]
  </code></pre>
  
  <p>Do I really have to copy the whole list?</p>