public boolean isModified(final Configurable configurable) {
    if (myModified.contains(configurable)) return true;

    if (configurable instanceof Configurable.InnerWithModifiableParent inner) {
      for (Configurable parent: inner.getModifiableParents()) {
        if (myModified.contains(parent)) return true;

        for (Configurable modified: myModified) {
          if (modified instanceof ConfigurableWrapper wrapper) {
            UnnamedConfigurable unwrapped = wrapper.getRawConfigurable();
            if (unwrapped != null && unwrapped.equals(parent)) return true;
          }
        }
      }
    }

    return false;
  }
public boolean isModified(final Configurable configurable)