from typing import Any
from typing import List


def next_wrap(current: Any, elements: List[Any], overlap_size: int = 0):
    """
    Get the next element in a wrap-able overlap-able list.

    Example:
        Given elements=[b, N, #], and overlap_size=1, we have that the next accidental after b, or # is N.
        i.e. a flat or sharp become natural when we raise it.
    """
    current_idx = elements.index(current)
    inside_overlap = current_idx > len(elements) - 1 - overlap_size
    idx = current_idx + 1 + (overlap_size if inside_overlap else 0)
    idx = idx % len(elements)
    return elements[idx]