@Override
    public void setCachedPresentation(@Nullable CachedTreePresentation presentation) {
      cachedPresentation = presentation == null ? null : new CachedPresentationImpl(presentation);
      if (cachedPresentation != null) {
        var rootPath = getRootPath();
        if (rootPath != null) {
          cachedPresentation.updateExpandedNodes(rootPath);
        }
      }
      // The order is important here because the model may immediately fire an event
      // that must be handled by expandImpl, so the model has to be updated last.
      if (getModel() instanceof CachedTreePresentationSupport cps) {
        cps.setCachedPresentation(presentation);
      }
    }
@Override
    public void setCachedPresentation(@Nullable CachedTreePresentation presentation)