public RUN_TRANSITION_STATE getRunTransitionState(Context context) {
    final VehicleState state = context.getState();
    final VehicleState parentState = context.getParentState();
    final Observation obs = context.getObservation();
    final Observation prevObs = obs.getPreviousObservation();
    final BlockStateObservation blockStateObs = state.getBlockStateObservation();

    if (parentState != null
        && prevObs != null
        && MotionModelImpl.hasRunChanged(
            parentState.getBlockStateObservation(), state.getBlockStateObservation())) {
      if (!Objects.equal(obs.getRecord().getRunId(), prevObs.getRecord().getRunId())
          || !Objects.equal(obs.getRecord().getOperatorId(), prevObs.getRecord().getOperatorId())) {

        return RUN_TRANSITION_STATE.RUN_CHANGE_INFO_DIFF;
      } else {
        EVehiclePhase parentPhase = parentState.getJourneyState().getPhase();

        /*
         * TODO clean up this hack We are really in-progress, but because of the
         * out-of-service headsign, we can't report it as in-progress
         */
        if (context.getObservation().hasOutOfServiceDsc()
            && EVehiclePhase.DEADHEAD_DURING == parentPhase
            && (blockStateObs != null && blockStateObs.isOnTrip()))
          parentPhase = EVehiclePhase.IN_PROGRESS;

        if (EVehiclePhase.isLayover(parentPhase)
            || EVehiclePhase.DEADHEAD_AFTER == parentPhase
            || EVehiclePhase.DEADHEAD_BEFORE == parentPhase
            || EVehiclePhase.DEADHEAD_DURING == parentPhase) {
          if (parentState.getBlockStateObservation() != null
              && !parentState.getBlockStateObservation().isRunFormal()
              && state.getJourneyState().getPhase() == EVehiclePhase.IN_PROGRESS)
            return RUN_TRANSITION_STATE.RUN_CHANGE_FROM_OOS_NORUN_TO_IN;
          else if (state.getJourneyState().getPhase() == EVehiclePhase.IN_PROGRESS)
            return RUN_TRANSITION_STATE.RUN_CHANGE_FROM_OOS_TO_IN;
          else return RUN_TRANSITION_STATE.RUN_CHANGE_FROM_OOS_TO_OSS;
        } else {
          return RUN_TRANSITION_STATE.RUN_CHANGE_FROM_IS;
        }
      }
    } else {
      if (blockStateObs == null
          && parentState != null
          && parentState.getBlockStateObservation() == null)
        return RUN_TRANSITION_STATE.RUN_CHANGE_FROM_OOS_TO_OSS;
      else return RUN_TRANSITION_STATE.RUN_NOT_CHANGED;
    }
  }