title: Should I return a Collection or a Stream?
body: <p>Suppose I have a method that returns a read-only view into a member list:</p>
  <pre class="lang-java prettyprint-override"><code>class Team {
      private List&lt;Player&gt; players = new ArrayList&lt;&gt;();
  
      // ...
  
      public List&lt;Player&gt; getPlayers() {
          return Collections.unmodifiableList(players);
      }
  }
  </code></pre>
  <p>Further suppose that all the client does is iterate over the list once, immediately. Maybe to put the players into a JList or something. The client does <em>not</em> store a reference to the list for later inspection!</p>
  <p>Given this common scenario, should I return a stream instead?</p>
  <pre class="lang-java prettyprint-override"><code>public Stream&lt;Player&gt; getPlayers() {
      return players.stream();
  }
  </code></pre>
  <p>Or is returning a stream non-idiomatic in Java? Were streams designed to always be &quot;terminated&quot; inside the same expression they were created in?</p>