def METHOD_NAME(n_intervals, min_length, max_length):
    """Test random interval length."""
    n_timepoints = 30
    x = np.arange(n_timepoints)
    intervals = _rand_intervals_fixed_n(
        x, n_intervals=n_intervals, min_length=min_length, max_length=max_length
    )
    lengths = intervals[:, 1] - intervals[:, 0]  # length = end - start
    assert np.all(lengths >= min_length)
    assert np.all(lengths <= max_length)