// Already scheduled
private void scheduleCleanup() {
        if (cleanupRegistration != null) {
            // Already scheduled
            return;
        }
        cleanupRegistration = ui.beforeClientResponse(ui, ignore -> {
            cleanupRegistration = null;
            pendingCleanup = false;
            // TODO Avoid copying by using Iterator.remove()
            properties.keySet().stream().filter(property -> !lastUsed.contains(property)).collect(Collectors.toList())
                    .forEach(unused -> properties.remove(unused).unregister());
        });
    }
private void scheduleCleanup() {
if (cleanupRegistration != null) {
// Already scheduled
return;
}
private void scheduleCleanup() {
if (cleanupRegistration != null) {
// Already scheduled
return;
}
cleanupRegistration = ui.beforeClientResponse(ui, ignore -> {
cleanupRegistration = null;
pendingCleanup = false;
// TODO Avoid copying by using Iterator.remove()
properties.keySet().stream().filter(property -> !lastUsed.contains(property)).collect(Collectors.toList())
.forEach(unused -> properties.remove(unused).unregister());
});
}
private void scheduleCleanup() {
if (cleanupRegistration != null) {
// Already scheduled
return;
}
cleanupRegistration = ui.beforeClientResponse(ui, ignore -> {
cleanupRegistration = null;
pendingCleanup = false;
// TODO Avoid copying by using Iterator.remove()
properties.keySet().stream().filter(property -> !lastUsed.contains(property)).collect(Collectors.toList())
.forEach(unused -> properties.remove(unused).unregister());
});
}