TreeMap<DestinationConfigKeyWrapper, MutableTreeNode> map = new TreeMap<DestinationConfigKeyWrapper, MutableTreeNode>(
new DestinationConfigKeyWrapperComparator());
for (int i = 0; i < getChildCount(); i++) {
DestinationConfigTreeNode child = (DestinationConfigTreeNode) getChildAt(i);
map.put(new DestinationConfigKeyWrapper(getHermes(), child.getConfig()), child);
}
map.put(new DestinationConfigKeyWrapper(getHermes(), node.getConfig()), node);
removeAllChildren();
for (Map.Entry<DestinationConfigKeyWrapper, MutableTreeNode> entry : map.entrySet()) {
super.add(entry.getValue());
}