sample_code

<pre> package org.example; import java.util.ArrayList; import java.util.List; public class LambdaTest { static class Employee { String name; String address; long salary; public Employee(String name, String address, long salary) { this.name = name; this.address = address; this.salary = salary; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getAddress() { return address; } public void setAddress(String address) { this.address = address; } public long getSalary() { return salary; } public void setSalary(long salary) { this.salary = salary; } @Override public String toString() { return &quot;Employee{&quot; + &quot;name=&#39;&quot; + name + &#39;\&#39;&#39; + &quot;, address=&#39;&quot; + address + &#39;\&#39;&#39; + &quot;, salary=&quot; + salary + &#39;}&#39;; } } public static void main(String[] args) { List&lt;Employee&gt; empList = new ArrayList&lt;&gt;(); empList.add(new Employee(&quot;Kishore&quot;, &quot;hyd&quot;, 1235)); empList.add(new Employee(&quot;Renu&quot;, &quot;nz&quot;, 2345)); empList.add(new Employee(&quot;Cherry&quot;, &quot;pan&quot;, 5678)); empList.add(new Employee(&quot;Gaya3&quot;, &quot;BZA&quot;, 56798)); List&lt;Employee&gt; finalList = empList.stream().filter(emp -&gt; emp.getSalary() &lt; 3000).peek(e -&gt; e.setSalary(15000)).toList(); System.out.println(finalList); } } </pre> <p>&nbsp;</p> <p>&nbsp;</p> <p>+++++++++++++++++++++++++++</p> <p>&nbsp;</p> <p>&nbsp;</p> <pre> package org.example; public class RunnableTest { public static void main(String[] args) { new Thread(new SampleThread()).start(); new Thread(new Runnable() { @Override public void run() { System.out.println(&quot;i am thread&quot;); } }).start(); new Thread(() -&gt; System.out.println(&quot;i am thread...?&quot;)).start(); } } </pre> <p>&nbsp;</p> <p>+++++++++++++++++++++++</p> <p>&nbsp;</p> <pre> package org.example; public class SampleThread implements Runnable { @Override public void run() { System.out.println(&quot;i Am full class thread...!&quot;); } } </pre> <p>&nbsp;</p> <p>&nbsp;</p> <p>+++++++++++++++++++++++++++++</p> <p>&nbsp;</p> <pre> package org.example; import java.util.Arrays; import java.util.List; import java.util.function.Predicate; public class PredicateTest { public static void main(String[] args) { List&lt;String&gt; names = Arrays.asList(&quot;kishore&quot;, &quot;Gayathre&quot;, &quot;cherry&quot;, &quot;renu&quot;); Predicate&lt;String&gt; pre = e -&gt; e.endsWith(&quot;e&quot;); names.forEach(e -&gt; { if(pre.test(e)) System.out.println(e); }); } } </pre>