title: java stream - flatmap with method reference
body: <p>I am new to java and to stream so my question is why does this work:</p>
  
  <p>This method is in my <code>Tree</code> class:</p>
  
  <pre><code>public Stream&lt;Tree&gt; flattened() {
      return Stream.concat(
              Stream.of(this),
              children.stream().flatMap(Tree::flattened));
  }
  </code></pre>
  
  <p>flatMap wants a function with t as param and flattened method doesnt have input parameters at all</p>
  
  <p>whats happening here?</p>