--- old/src/share/classes/java/util/stream/package-info.java 2013-07-05 16:28:54.454021321 -0700 +++ new/src/share/classes/java/util/stream/package-info.java 2013-07-05 16:28:50.258021396 -0700 @@ -547,7 +547,7 @@ * List l = new ArrayList(Arrays.asList("one", "two")); * Stream sl = l.stream(); * l.add("three"); - * String s = sl.collect(toStringJoiner(" ")).toString(); + * String s = sl.collect(joining(" ")); * } * First a list is created consisting of two strings: "one"; and "two". Then a stream is created from that list. * Next the list is modified by adding a third string: "three". Finally the elements of the stream are collected @@ -557,7 +557,7 @@ *
{@code
  *     List l = new ArrayList(Arrays.asList("one", "two"));
  *     Stream sl = l.stream();
- *     String s = sl.peek(s -> l.add("BAD LAMBDA")).collect(toStringJoiner(" ")).toString();
+ *     String s = sl.peek(s -> l.add("BAD LAMBDA")).collect(joining(" "));
  * }
* then a {@code ConcurrentModificationException} will be thrown since the {@code peek} operation will attempt * to add the string "BAD LAMBDA" to the list after the terminal operation has commenced.