@Test
public void noNextReasons() {

    fdb.run(context -> {
        KeyValueCursor cursor = KeyValueCursor.Builder.withSubspace(subspace)
                .setContext(context)
                .setRange(TupleRange.allOf(Tuple.from(3)))
                .setContinuation(null)
                .setScanProperties(ScanProperties.FORWARD_SCAN.with(props -> props.setReturnedRowLimit(3)))
                .build();
        assertEquals(Arrays.asList(Tuple.from(3L, 0L), Tuple.from(3L, 1L), Tuple.from(3L, 2L)),
                cursor.map(KeyValue::getValue).map(Tuple::fromBytes).asList().join());
        RecordCursorResult<KeyValue> result = cursor.getNext();
        assertEquals(RecordCursor.NoNextReason.RETURN_LIMIT_REACHED, result.getNoNextReason());
        cursor = KeyValueCursor.Builder.withSubspace(subspace)
                .setContext(context)
                .setRange(TupleRange.allOf(Tuple.from(3)))
                .setContinuation(result.getContinuation().toBytes())
                .setScanProperties(ScanProperties.FORWARD_SCAN.with(props -> props.setReturnedRowLimit(3)))
                .build();
        assertEquals(Arrays.asList(Tuple.from(3L, 3L), Tuple.from(3L, 4L)),
                cursor.map(KeyValue::getValue).map(Tuple::fromBytes).asList().join());
        result = cursor.getNext();
        assertEquals(RecordCursor.NoNextReason.SOURCE_EXHAUSTED, result.getNoNextReason());
        assertNull(result.getContinuation().toBytes());
        return null;
    });
}