title: Java 8 streaming: How to convert list of objects to a list of its selected properties
body: <p>I have a class</p>
  
  <pre><code>class Person {
     // get/set omitted for simplicity
     public String firstName;
     public String lastName;
  }
  </code></pre>
  
  <p>also I have a list of such objects</p>
  
  <pre><code>List&lt;Person&gt; list ...
  </code></pre>
  
  <p>I need to convert with the streams the following</p>
  
  <pre><code>List&lt;Person&gt; list ...
  List&lt;String&gt; firstLastNames = list.stream()....
  </code></pre>
  
  <p>So my List firstLastNames will contain first and last names in this list. So. </p>
  
  <pre><code>System.out.println(firstLastNames); // will give me -&gt; "John", "Smith", "Jessica", "Jones".. etc.
  </code></pre>