void synchronizeChildren() {
    List<CachingChildrenTreeNode<?>> children = myChildren;
    if (myOldChildren != null && children != null) {
      HashMap<Object, CachingChildrenTreeNode> oldValuesToChildrenMap = new HashMap<>();
      for (CachingChildrenTreeNode oldChild : myOldChildren) {
        final Object oldValue = oldChild instanceof TreeElementWrapper ? oldChild.getValue() : oldChild;
        if (oldValue != null) {
          oldValuesToChildrenMap.put(oldValue, oldChild);
        }
      }

      for (int i = 0; i < children.size(); i++) {
        CachingChildrenTreeNode newChild = children.get(i);
        final Object newValue = newChild instanceof TreeElementWrapper ? newChild.getValue() : newChild;
        if (newValue != null) {
          final CachingChildrenTreeNode oldChild = oldValuesToChildrenMap.get(newValue);
          if (oldChild != null) {
            oldChild.copyFromNewInstance(newChild);
            oldChild.setValue(newChild.getValue());
            children.set(i, oldChild);
          }
        }
      }

      myOldChildren = null;
    }
  }
void synchronizeChildren()