title: Using streams to convert a list of objects into a string obtained from the toString method
body: <p>There are a lot of useful new things in Java 8. E.g., I can iterate with a stream over a list of objects and then sum the values from a specific field of the <code>Object</code>'s instances. E.g.</p>
  
  <pre><code>public class AClass {
    private int value;
    public int getValue() { return value; }
  }
  
  Integer sum = list.stream().mapToInt(AClass::getValue).sum();
  </code></pre>
  
  <p>Thus, I'm asking if there is any way to build a <code>String</code> that concatenates the output of the <code>toString()</code> method from the instances in a single line.</p>
  
  <pre><code>List&lt;Integer&gt; list = ...
  
  String concatenated = list.stream().... //concatenate here with toString() method from java.lang.Integer class
  </code></pre>
  
  <p>Suppose that <code>list</code> contains integers <code>1</code>, <code>2</code> and <code>3</code>, I expect that <code>concatenated</code> is <code>"123"</code> or <code>"1,2,3"</code>.</p>