title: How do I group lines of strings separated by empty lines using java stream
body: <p>I have the following input and I would like them to be grouped using the empty line as the logical divider.
  input datatype:
  <code>List&lt;String&gt;</code></p>
  <pre><code>line1
  line2
  line3
  
  line4
  line5
  line6
  
  line7
  line8
  </code></pre>
  <p>expected output:
  type: List&lt;List&gt;</p>
  <pre><code>{{line1, line2, line3}, {line4, line5, line6}, {line7, line8}}
  </code></pre>
  <p>While this is trivial using imperative programming, I am looking for a solution that uses functional programming in Java.</p>