title: Filter folder and files into tree (composite pattern)
body: <p>I cannot create sort method to put folders and files into tree structure. I am using composite pattern, I have Leaf (File) and Node(Directory). And also I have a list of Entries. I cannot figure out how to elagantly to sort them and create tree structure.<br>
  Here is an example of output </p>
  
  <pre><code>org/apache/logging/log4j/core/osgi/is directory !
  org/apache/logging/log4j/core/pattern/is directory !
  org/apache/logging/log4j/core/selector/is directory !
  org/apache/logging/log4j/core/tools/is directory !
  org/apache/logging/log4j/core/util/is directory !
  Log4j-config.xsd
  Log4j-events.dtd
  Log4j-events.xsd
  Log4j-levels.xsd
  META-INF/LICENSE
  META-INF/log4j-provider.properties
  META-INF/NOTICE
  META-INF/org/apache/logging/log4j/core/config/plugins/Log4j2Plugins.dat
  META-INF/services/javax.annotation.processing.Processor
  org/apache/logging/log4j/core/AbstractLifeCycle.class
  org/apache/logging/log4j/core/AbstractLogEvent.class
  org/apache/logging/log4j/core/appender/AbstractAppender.class
  </code></pre>
  
  <p>I can determine in what directory put entry only by path. I have no idea how to do this correctly.<br>
  I have two classes (composite pattern) EntryFile and EntryFolder they both extends Entry, EntryFolder in turn has method to add Entry objects.<br>
  Please suggest how to do this. My brain doesn't want to work.<br>
  Thx in advance.</p>