title: How to append a separator string when using System.out::print to print String[]?
body: <p>I am trying to learn and get comfortable using lambdas, streams and method references - all the new-fangled Java 11 stuff.</p>
  <p>I want to sort and print out the array of strings, keeping the null intact.
  In the last line, how can I print the names with spaces?
  (a general case would be printing each name with a message).
  The current output is:</p>
  <blockquote>
  <p>nullGoyleMalfoyCrabbe</p>
  </blockquote>
  <p>I want</p>
  <blockquote>
  <p>null Goyle Malfoy Crabbe</p>
  </blockquote>
  <p>without a space after the last element.</p>
  <pre><code>ArrayList&lt;String&gt; enemies = new ArrayList&lt;&gt;(Arrays.asList(&quot;Malfoy&quot;, &quot;Crabbe&quot;, &quot;Goyle&quot;, null));
  List&lt;String&gt; es = enemies.stream().map(object -&gt; Objects.toString(object,null)).collect(Collectors.toList());
  String[] as = es.toArray(String[]::new);
  Arrays.sort(as, Comparator.nullsFirst((a,b) -&gt; a.length() - b.length()));
  Arrays.stream(as).forEach(System.out::print);
  </code></pre>