@Test
public void noNextReasons() {

    // Both one out of band limit reached
    RecordCursor<Integer> cursor = ProbableIntersectionCursor.create(Collections::singletonList,
            cursorsToFunctions(Arrays.asList(
                    new RecordCursorTest.FakeOutOfBandCursor<>(RecordCursor.fromList(Arrays.asList(1, 4, 3, 7, 9)), 3),
                    new RecordCursorTest.FakeOutOfBandCursor<>(RecordCursor.fromList(Arrays.asList(3, 7, 8, 4, 1)), 2)
            )),
            null,
            null);
    verifyResults(cursor, RecordCursor.NoNextReason.TIME_LIMIT_REACHED, 3);
    // One in-band limit reached, one out of band
    cursor = ProbableIntersectionCursor.create(Collections::singletonList,
            cursorsToFunctions(Arrays.asList(
                    new RecordCursorTest.FakeOutOfBandCursor<>(RecordCursor.fromList(Arrays.asList(1, 4, 3, 7, 9)), 3),
                    RecordCursor.fromList(Arrays.asList(3, 7, 8, 4, 1)).limitRowsTo(2)
            )),
            null,
            null);
    verifyResults(cursor, RecordCursor.NoNextReason.TIME_LIMIT_REACHED, 3);
    // Both in-band limit reached
    cursor = ProbableIntersectionCursor.create(Collections::singletonList,
            cursorsToFunctions(Arrays.asList(
                    RecordCursor.fromList(Arrays.asList(1, 4, 3, 7, 9)).limitRowsTo(3),
                    RecordCursor.fromList(Arrays.asList(3, 7, 8, 4, 1)).limitRowsTo(2)
            )),
            null,
            null);
    verifyResults(cursor, RecordCursor.NoNextReason.RETURN_LIMIT_REACHED, 3);
    // One out-of-band limit reached, one exhausted
    cursor = ProbableIntersectionCursor.create(Collections::singletonList,
            cursorsToFunctions(Arrays.asList(
                    new RecordCursorTest.FakeOutOfBandCursor<>(RecordCursor.fromList(Arrays.asList(1, 4, 3, 7, 9)), 3),
                    RecordCursor.fromList(Arrays.asList(3, 7, 8, 4, 1))
            )),
            null,
            null);
    verifyResults(cursor, RecordCursor.NoNextReason.TIME_LIMIT_REACHED, 3, 4, 1);
    // One in band limit reached, one exhausted
    cursor = ProbableIntersectionCursor.create(Collections::singletonList,
            cursorsToFunctions(Arrays.asList(
                    RecordCursor.fromList(Arrays.asList(1, 4, 3, 7, 9)).limitRowsTo(3),
                    RecordCursor.fromList(Arrays.asList(3, 7, 8, 4, 1))
            )),
            null,
            null);
    verifyResults(cursor, RecordCursor.NoNextReason.RETURN_LIMIT_REACHED, 3, 4, 1);
    // Both exhausted
    cursor = ProbableIntersectionCursor.create(Collections::singletonList,
            cursorsToFunctions(Arrays.asList(
                    RecordCursor.fromList(Arrays.asList(1, 4, 3, 7, 9)),
                    RecordCursor.fromList(Arrays.asList(3, 7, 8, 4, 1))
            )),
            null,
            null);
    verifyResults(cursor, RecordCursor.NoNextReason.SOURCE_EXHAUSTED, 3, 7, 4, 1);
}