title: Which is good practice - Modifying a List in the method, or returning a new List in the method?
body: <p>Example code:</p>
  
  <pre><code>modifyMyList(myList);
  
  public void modifyMyList(List someList){
      someList.add(someObject);
  }
  </code></pre>
  
  <p>or:</p>
  
  <pre><code>List myList = modifyMyList(myList);
  
  public List modifyMyList(List someList){
      someList.add(someObject)
      return someList;
  }
  </code></pre>
  
  <p>There is also a 3rd option I believe: You can create a new List in modifyMyList method and return this new List...</p>
  
  <p>( 3rd option is here, I was too lazy but someone already added it in the answers: ) </p>
  
  <pre><code>List myList = modifyMyList(myList);
  
  public List modifyMyList(List someList){
      List returnList = new ArrayList();
      returnList.addAll(someList);
      returnList.add(someObject);
      return Collections.unmodifiableList(returnList);
  }
  </code></pre>
  
  <p>Is there any reason why I should choose one over another? What should be considered in such case? </p>