def METHOD_NAME(self, next_status: Status) -> None:
    """Validate status transition and set next status.
    The caller of the transition method will have to aquire conditional variable.
    """
    if next_status == Status.CLOSED:
        self._status = next_status
    elif (
        self._status == Status.AWAITING_INS_WRAPPER
        and next_status == Status.INS_WRAPPER_AVAILABLE
        and self._ins_wrapper is not None
        and self._res_wrapper is None
    ):
        self._status = next_status
    elif (
        self._status == Status.INS_WRAPPER_AVAILABLE
        and next_status == Status.AWAITING_RES_WRAPPER
        and self._ins_wrapper is None
        and self._res_wrapper is None
    ):
        self._status = next_status
    elif (
        self._status == Status.AWAITING_RES_WRAPPER
        and next_status == Status.RES_WRAPPER_AVAILABLE
        and self._ins_wrapper is None
        and self._res_wrapper is not None
    ):
        self._status = next_status
    elif (
        self._status == Status.RES_WRAPPER_AVAILABLE
        and next_status == Status.AWAITING_INS_WRAPPER
        and self._ins_wrapper is None
        and self._res_wrapper is None
    ):
        self._status = next_status
    else:
        raise Exception(f"Invalid transition: {self._status} to {next_status}")
    self._cv.notify_all()