title: Stream of Stream: cannot convert from Stream<Object>
body: <p>The goal is to call a function with all elements from a stream of stream.</p>
  
  <p>The issues I have is more complicated, but I manage to reproduce with this simple code.</p>
  
  <p>With the following code, I get this error: </p>
  
  <pre><code> Type mismatch: cannot convert from Stream&lt;Object&gt; to Stream&lt;Integer&gt;
  
  
  
      import java.util.List;
      import java.util.stream.Stream;
  
      class Ideone
      {
          public class A {
              String a = "a";
              List&lt;B&gt; bList;
          }
  
  
          public class B {
              String b = "b";
              List&lt;String&gt; urls;
          }
  
  
          public Stream&lt;Integer&gt; getResult (String a, String b, String url) {
              System.out.println("Bingo!");
              return Stream.empty();
          }
  
  
  
          public static void main (String[] args) throws java.lang.Exception
          {
              A a = new A();
             Stream&lt;Integer&gt; rez = a.bList.stream().map(b -&gt; b.urls.stream().map(u -&gt; getResult(a.a, b.b, u)));
          }
      }
  </code></pre>