title: Trying to understand the complete meaning of a below statement Stream.of(bufferedReader.readLine().replaceAll("\\s$", "")
body: <p>I am adding screenshot for some more information. I am new to Java8, kindly forgive me if I am asking a bad question. When I was doing research for input of space separated value I got this statement.
      I understand that below statement takes value as <code>1 2 3</code> and returns value<code>[1, 2, 3]</code>as a list.</p>
  
  <p>Kindly correct me if I am wrong,</p>
  
  <ul>
  <li><p>Stream: is used on collection for iteration.</p></li>
  <li><p>bufferedReader.readLine(): it reads the line as string</p></li>
  <li>replaceAll: is replacing space with <code>,</code> later it gets parse into Integer and being collected into List</li>
  </ul>
  
  <p>My doubt is when I am inputting <code>1 2 3</code> which is a string. So, is this stream first splitting the value with space then iterating on splitted value? or is it 1st parsing the value later storing the value in list later splitting value with space and removing space and replacing with <code>,</code>. I am very curious, how exactly below statement is working.</p>
  
  <pre><code>List&lt;Integer&gt; a = Stream.of(bufferedReader.readLine().replaceAll("\\s$", "").split(" "))
                  .map(Integer::parseInt)
                  .collect(toList());
  
  
    [1]: https://i.stack.imgur.com/nlXxd.jpg
  </code></pre>