@Override
    public @Nullable Boolean getNextState(@NotNull Map<T, Boolean> elementsWithStates) {
      boolean currentlyMarked = true;
      for (Boolean state : elementsWithStates.values()) {
        currentlyMarked = state;
        if (!currentlyMarked) {
          break;
        }
      }
      return !currentlyMarked;
    }
@Override
    public @Nullable Boolean getNextState(@NotNull Map<T, Boolean> elementsWithStates)