title: How to convert list of object to another list object using streams?
body: <p>The below code snippet, has been implemented without lambda expressions.  </p>
  
  <p>How to implement the same functionality using lambda expressions?</p>
  
  <pre><code>public class Java8EmpTest {
      public static void main(String[] args) {
          // TODO Auto-generated method stub
  
          List&lt;Emp&gt; empInList = Arrays.asList(new Emp(1, 100), new Emp(2, 200), new Emp(3, 300));
          List&lt;Emp&gt; afterSalayHikeInJava7 = new ArrayList&lt;&gt;();
          // old way
          for (Emp emp : empInList) {
              afterSalayHikeInJava7.add(new Emp(emp.getId(), emp.getSalary() * 100));
          }
          afterSalayHikeInJava7.stream()
                  .forEach(s -&gt; System.out.println("Id :" + s.getId() + " Salary :" + s.getSalary()));
      }
  }
  
  class Emp {
      private int id;
      private int salary;
  
      public int getId() {
          return id;
      }
  
      Emp(int id, int salary) {
          this.id = id;
          this.salary = salary;
      }
  
      public int getSalary() {
          return salary;
      }
  }
  </code></pre>