title: Error in Types in Lamdba Expressions Java and Stream
body: <p>I'm learning how Streams work in java and I found some examples, but when I am trying to run this, this throws some exceptions because the lambda expressions. I would like to understand why.</p>
  <pre class="lang-java prettyprint-override"><code>import java.util.Arrays;
  import java.util.List;
  import java.util.stream.Collectors;
  
  public class StreamExample {
  
      public static void main (String[] args) {
          
          List number = Arrays.asList(2, 3, 4, 5);
          List square = number.stream().map(x-&gt; x*x).collect(Collectors.toList());
  
          List names = Arrays.asList(&quot;Reflection&quot;,&quot;Collection&quot;,&quot;Stream&quot;);
          List result = names.stream().filter(s-&gt;s.startsWith(&quot;S&quot;)).collect(Collectors.toList());
          
      }
  }
  </code></pre>
  <p>I get these two errors.</p>
  <pre class="lang-sh prettyprint-override"><code>Operator '*' cannot be applied to 'java.lang.Object', 'java.lang.Object'
  Cannot resolve method 'startsWith' in 'Object'
  </code></pre>
  <p>Thanks for the help</p>