title: Equivalent lambda expression, to get a property of every object in a list
body: <p>What is the equivalent lambda expression of this for loop in Java?<br>
  I just want to print, in a line, the names of the objects of a list.  </p>
  
  <pre><code>for(Attribute attr : dataSet.getAttributeList()){
              System.out.print(attr.getName() + " ");
          }
  </code></pre>
  
  <p>I tried the following but without any luck, I only got the identity hash code of the stream.
  <code>Arrays.asList(dataSet.getAttributeList().stream().map(p -&gt; p.getName()));</code></p>