def pairs_to_annotations(annotation_pairs):
    """
    Convert an array of annotations pairs to annotation array.
    :param annotation_pairs: list(AnnotationPair) - annotations
    :return: list(Annotation)
    """
    annotations = []
    for ap in annotation_pairs:
        if ap.ann1 is not None:
            annotations.append(ap.ann1)
        if ap.ann2 is not None:
            annotations.append(ap.ann2)

    return annotations