@Test
public void simpleScanLimit() {

    fdb.run(context -> {
        RecordScanLimiter limiter = RecordScanLimiterFactory.enforce(2);
        KeyValueCursor cursor = KeyValueCursor.Builder.withSubspace(subspace)
                .setContext(context)
                .setRange(TupleRange.ALL)
                .setScanProperties(forwardScanWithLimiter(limiter))
                .build();
        assertEquals(2, (int) cursor.getCount().join());
        RecordCursorResult<KeyValue> result = cursor.getNext();
        assertThat("no next reason should be SCAN_LIMIT_REACHED", result.getNoNextReason(),
                equalTo(RecordCursor.NoNextReason.SCAN_LIMIT_REACHED));
        return null;
    });
}