public void setChildComparator(Comparator<Entry> childComparator) {
        if (childComparator == null) {
            throw new IllegalArgumentException("childComparator cannot be null");
        }
        
        this.childComparator = childComparator;
        
        if (this.children != null) {
            //TODO loop detection?
            for (Map.Entry<Long, Entry> entry : this.children.entrySet()) {
                final Entry child = entry.getValue();
    
                if (child instanceof Folder) {
                    ((Folder)child).setChildComparator(childComparator);
                }
            }
        }
    }