def get_annotation_of_violation(annotations, violation):
    """
    Returns the annotation this violation violates.
    :param annotations: List of annotations.
    :param violation: The violation that violates the searched annotation.
    :return: The violated annotation.
    """
    for annotation in annotations:
        if violation in annotation.violations:
            return annotation