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) {
           
            return;
        }
        cleanupRegistration = ui.beforeClientResponse(ui, ignore -> {
            cleanupRegistration = null;
            pendingCleanup = false;
           
            properties.keySet().stream().filter(property -> !lastUsed.contains(property)).collect(Collectors.toList())
                    .forEach(unused -> properties.remove(unused).unregister());
        });
    }
private void schedulecleanup() { if (cleanupregistration != null) { return; } cleanupregistration = ui.beforeclientresponse(ui, ignore -> { cleanupregistration = null; pendingcleanup = false; properties.keyset().stream().filter(property -> !lastused.contains(property)).collect(collectors.tolist()) .foreach(unused -> properties.remove(unused).unregister()); }); }