title: Split list of objects into multiple lists of fields values using Java streams
body: <p>Let's say I have such object:</p>
  
  <pre><code>public class Customer {
  
      private Integer id;
      private String country;
      private Integer customerId;
      private String name;
      private String surname;
      private Date dateOfBirth;
  }
  </code></pre>
  
  <p>and I have a <code>List&lt;Customer&gt;</code>. I would like to split such list with Java streams so that I would get a list of ids <code>List&lt;Integer&gt;</code>, countries <code>List&lt;String&gt;</code>, customerIds <code>List&lt;Integer&gt;</code> etc.</p>
  
  <p>I know that I could do it as simple as making 6 streams such as:</p>
  
  <pre><code>List&lt;Integer&gt; idsList = customerList.stream()
          .map(Customer::getId)
          .collect(Collectors.toList());
  </code></pre>
  
  <p>but doing it that many times that I have fields seems pretty dull. I was thinking about custom Collector but I could not come up with anything useful that would be both neat and efficient.</p>