@Test
public void all() {

    fdb.run(context -> {
        KeyValueCursor cursor = KeyValueCursor.Builder.withSubspace(subspace)
                .setContext(context)
                .setRange(TupleRange.ALL)
                .setContinuation(null)
                .setScanProperties(ScanProperties.FORWARD_SCAN)
                .build();
        for (int i = 0; i < 5; i++) {
            for (int j = 0; j < 5; j++) {
                KeyValue kv = cursor.getNext().get();
                assertArrayEquals(subspace.pack(Tuple.from(i, j)), kv.getKey());
                assertArrayEquals(Tuple.from(i, j).pack(), kv.getValue());
            }
        }
        assertThat(cursor.getNext().hasNext(), is(false));
        cursor = KeyValueCursor.Builder.withSubspace(subspace)
                .setContext(context)
                .setRange(TupleRange.ALL)
                .setContinuation(null)
                .setScanProperties(new ScanProperties(ExecuteProperties.newBuilder().setReturnedRowLimit(10).build()))
                .build();
        assertEquals(10, (int)cursor.getCount().join());
        cursor = KeyValueCursor.Builder.withSubspace(subspace)
                .setContext(context)
                .setRange(TupleRange.ALL)
                .setContinuation(cursor.getNext().getContinuation().toBytes())
                .setScanProperties(ScanProperties.FORWARD_SCAN)
                .build();
        assertEquals(15, (int)cursor.getCount().join());
        return null;
    });
}