def METHOD_NAME(self):
    if self.upper_layer is None:
        raise RuntimeError("create_upper_layer or create_schc_protocol "
                           "should be called first")
    return self.upper_layer