title: Stream of Strings isn't sorted?
body: <p>i would like to find the set of all words in a file.This set should be sorted.
  Upper and Lower Case doesn't matter. 
  Here is my approach:</p>
  
  <pre><code>public static Set&lt;String&gt; setOfWords(String fileName) throws IOException {
  
      Set&lt;String&gt; wordSet;
      Stream&lt;String&gt; stream = java.nio.file.Files.lines(java.nio.file.Paths.get(fileName));
  
      wordSet = stream
                  .map(line -&gt; line.split("[ .,;?!.:()]"))
                  .flatMap(Arrays::stream)
                  .sorted()
                  .map(String::toLowerCase)
                  .collect(Collectors.toSet());
      stream.close();
      return wordSet;
  }
  </code></pre>
  
  <p>Test file:</p>
  
  <p>This is a file with 
  five lines.It has two sentences, 
  and the word file is contained 
  in multiple lines of this file. 
  This file can be used for testing?</p>
  
  <p>When printing the set, i get the following output:</p>
  
  <pre><code>Set of words: 
  a
  be
  in
  sentences
  testing
  this
  for
  multiple
  is
  it
  used
  two
  the
  can
  with
  contained
  file
  and
  of
  has
  lines
  five
  word
  </code></pre>
  
  <p>Can anybody tell me, why the set is not sorted in it's natural order(for Strings lexiographic)?</p>
  
  <p>Thanks in advance</p>