def METHOD_NAME(self, message: MessageBase) -> None:
    if isinstance(message, TestRunMessage):
        self._received_test_run(message)
    elif isinstance(message, TestResultMessage):
        self._received_test_result(message)
    else:
        raise LisaException(f"received unknown message type: {message}")