title: Java8 Transform list of object to list of one attribute of object
body: <p>I want to use Java 8 tricks to do the following in one line.</p>
  
  <p>Given this object definition:</p>
  
  <pre><code>@Getter
  @Setter
  @NoArgsConstructor
  @AllArgsConstructor
  public class MyObj {
      private String id;
      private Double value;
  }
  </code></pre>
  
  <p>and a <code>List&lt;MyObj&gt; objects</code>, I want to get a <code>List&lt;String&gt; objectIds</code> which is a list of all <code>id</code>s of the objects in the first list - in the same order.</p>
  
  <p>I can do this using a loop in Java but I believe there should be a one-liner lambda in Java8 that can do this. I was not able to find a solution online. Perhaps I wasn't using the right search terms.</p>
  
  <p>Could someone suggest a lambda or another one-liner for this transform?</p>