title: Extract list values from list of in java
body: <pre><code>public class FetchVarableList {
  
  public static void main(String[] args) {
      
      List&lt;List&lt;Employee&gt;&gt; empsList = new ArrayList&lt;&gt;();
  
      Employee e1 = new Employee(1, &quot;Abi&quot;, &quot;Fin&quot;, 2000);
      Employee e2 = new Employee(2, &quot;Chandu&quot;, &quot;OPs&quot;, 5000);
      Employee e3 = new Employee(3, &quot;mahesh&quot;, &quot;HR&quot;, 8000);
      Employee e4 = new Employee(4, &quot;Suresh&quot;, &quot;Main&quot;, 1000);
      
      
      List&lt;Employee&gt; empList = new ArrayList&lt;&gt;();
      empList.add(e1); empList.add(e2); 
  
      
      List&lt;Employee&gt; empList2 = new ArrayList&lt;&gt;();
      
      empList2.add(e3); empList2.add(e4);
  
      
      empsList.add(empList);
      
      empsList.add(empList2);
  }
  </code></pre>
  <p>}</p>
  <p>The code above has a list of employee e1, e2 in <code>empList</code> and e3, e4 in <code>empList2</code>. These two lists are added to <code>empslist</code>. I would like to fetch all employee numbers and store them in a single list of Integers.</p>
  <p>How to get the list of employee numbers from <code>empslist</code> in Java8?</p>