title: Is it acceptable to return unmodifiableList or should I return array?
body: <p>I have method <code>List&lt;Foo&gt; getFoos ()</code> which gets the data from remote server and returns it.</p>
  
  <p>Of course, user shouldn't change number of items of the list because he'll get data not synchronized with data on the server (and if he want change number of items he has special methods like <code>addFoo ()</code>). </p>
  
  <p>First approach was to return array and change method's signature to <code>Foo[] getFoos ()</code>. But it's more common in java and more convenient to user to operate with collections so I changed signature to <code>List&lt;Foo&gt; getFoos ()</code>. This method always returns </p>
  
  <p><code>Collections.unmodifiableList (originalList)</code></p>
  
  <p>So, when user try to change the list he will get RuntimeException. </p>
  
  <p>Are there any recommendations about api design in similar cases?</p>