TreeNode (final String key, final boolean isFolder) { final ByKeySelectedSearcher searcher = (isFolder) ? new FolderByKeySelectedSearcher(key, myChildren) : new FileByKeySelectedSearcher(key, myChildren); return searcher.getNextSelectedByKey(); }