code: public Integer getStateId(S state){
  		Integer id = states.get(state);
  		if (id == null){
  			throw new IllegalArgumentException("State '" + state + "' has not been defined.");
  		}
  		return id;
  	}
docs: Get the internal integer ID of a state.
  @param state	the state
  @return	the integer ID of that state