title: How to get a List of objects having a particular property using Predicate
body: <p>I'm trying to find all the employees whose salary is greater than 50k using a lambda expression.</p>
  <p>But I'm not able to access the <code>getSalary()</code> method.</p>
  <pre><code>ArrayList&lt;emp&gt; list=new ArrayList&lt;&gt;();
  list.add(new emp(&quot;Ronaldo&quot;,1,90000,&quot;UTD&quot;));
  list.add(new emp(&quot;Rooney&quot;,2,40000,&quot;HOME&quot;));
  
  Predicate&lt;ArrayList&lt;emp&gt;&gt; p3 = (s) -&gt; s.getSalary() &gt; 50000;
  
  System.out.println(p3.test(list));
  </code></pre>