title: How can I create a stream of <Interface> objects?
body: <p>Let's say I have:</p>
  <pre><code>interface SomeInterface {       
     Foo getFoo();
  }
  </code></pre>
  <p>and</p>
  <pre><code>class SomeClass implements SomeInterface {
      Foo getFoo() {
         //returns a Foo object
      }
  }
  </code></pre>
  <p>Then in a service, I have:</p>
  <pre><code>List&lt;SomeClass&gt; getItems() {
     //returns a list of SomeClass objects
  }
  </code></pre>
  <p>It is not allowed to do the following:</p>
  <pre><code>Stream&lt;SomeInterface&gt; items = service.getItems().stream();
  </code></pre>
  <p>But ultimately, I have other classes that would share this interface and would want to do:</p>
  <pre><code>someMethod(Stream&lt;SomeInterface&gt; items) {
     //some operation
  }
  </code></pre>
  <p>Is there a way around this?  Like using <code>flatMap</code>?  (I noticed that if I have a wrapper class on a <code>List</code> of <code>SomeClass</code> objects, I can <code>flatMap</code> the wrapper to return a stream of <code>SomeInterface</code> objects.)</p>
  <p>I didn't find similar questions and don't readily see the solution.  Could be something easy I'm missing.  Java 14.</p>