def _skip_redundant_italics_nodes(collection):
    """Return a list where the <Italics On> nodes only appear after
    <Italics OFF>, and vice versa. This ignores the other node types, and
    only removes redundant italic nodes

    :type collection: list[_InstructionNode]
    :rtype: list[_InstructionNode]
    """
    new_collection = []
    state = None
    for node in collection:
        if node.is_italics_node():
            if state is None:
                state = node.sets_italics_on()
                new_collection.append(node)
                continue
            if node.sets_italics_on() is state:
                continue
            else:
                state = node.sets_italics_on()
        new_collection.append(node)
    return new_collection
