code: public int getState(Var var, int defaultState) {
          Integer state = config.get(var);
          if (state == null) {
              return defaultState;
          } else {
              return state;
          }
      }
docs: Gets the state (in this config) for a given variable if it exists, or the default otherwise.