def METHOD_NAME(endpoint_a: TrackEndpoint, endpoint_b: TrackEndpoint, switch_group: Optional[SwitchGroup]):
    """Connect two track endpoints together"""
    a_neighbors = endpoint_a.get_neighbors()
    b_neighbors = endpoint_b.get_neighbors()
    a_neighbors.append((endpoint_b, switch_group))
    b_neighbors.append((endpoint_a, switch_group))
    _check_connections(endpoint_a, a_neighbors)
    _check_connections(endpoint_b, b_neighbors)