title: Java. Retrieve subtree by parent node
body: <p>I have tree with the following node spec:</p>
  
  <pre><code>java.util.TreeMap&lt;Long id, java.util.TreeMap children&gt;
  </code></pre>
  
  <p>When I fill this map, I would like to retieve subtree only by id.</p>
  
  <p>E.G. 
  Tree is:</p>
  
  <pre><code>     /-4
     /-2
  1 &lt;    /-5
     \-3&lt;
         \-6
  </code></pre>
  
  <p>And when I'm using my code for ID=3, I would like to return only TreeMap with parentNode = 3</p>
  
  <p>Thanks in advice</p>