@Override
  public <T> void saveState(@NotNull final FacetType<?, ?> type, final T state) {
    String id = type.getStringId();
    if (state != null) {
      myFacetTypeStates.put(id, state);
    }
    else {
      myFacetTypeStates.remove(id);
      myBean.getFacetTypeElements().remove(id);
    }
  }
@Override
  public <T> void saveState(@NotNull final FacetType<?, ?> type, final T state)