@Test
public void testSetWindow() {

    Map<String, Long> oldMappings = new HashMap<>();
    try (FDBRecordContext context = database.openContext()) {
        for (int i = 0; i < 20; i++) {
            String key = "old-resolved-" + i;
            Long value = globalScope.resolve(context.getTimer(), key).join();
            oldMappings.put(key, value);
        }
    }
    globalScope.setWindow(10000L).join();
    try (FDBRecordContext context = database.openContext()) {
        for (int i = 0; i < 20; i++) {
            Long value = globalScope.resolve(context.getTimer(), "new-resolved-" + i).join();
            assertThat("resolved value is larger than the set window", value, greaterThanOrEqualTo(10000L));
        }
        for (Map.Entry<String, Long> entry : oldMappings.entrySet()) {
            Long value = globalScope.resolve(context.getTimer(), entry.getKey()).join();
            assertThat("we can still read the old mappings", value, is(entry.getValue()));
        }
    }
}