code: public boolean addToSet(State<S, EP> state) {
          boolean first = list.isEmpty();
          if (first || !setContents.get(state.getId())) {
              list.add(state);
              setContents.set(state.getId());
          }
          return first;
      }
docs: Adds a state to the associated state set. Note that a state can be in the sets of various transition labels.
  
  @param state
  the state to be added.
  
  @return <code>true</code> if this was the first state to be added to the set, <code>false</code> otherwise.