title: How to convert list without generics to list with generics using streams in java?
body: <p>I would like convert a <code>List</code> without generics to <code>List&lt;MyConcreteType&gt;</code>.</p>
  
  <p>I also need to filter out only my concrete types.</p>
  
  <p>My current stream logic is like:</p>
  
  <pre><code>List list = new ArrayList();
  Object collect1 = list.stream().filter((o -&gt; o instanceof MyConcreteType)).collect(Collectors.toList());
  </code></pre>
  
  <p>But as a result I'm getting an <code>Object</code> instead of a <code>List</code>. Is there a way to convert this <code>Stream</code> to a <code>List&lt;MyConcreteType&gt;</code>?</p>