diff --git a/flow-data/src/main/java/com/vaadin/flow/data/provider/hierarchy/HierarchicalCommunicationController.java b/flow-data/src/main/java/com/vaadin/flow/data/provider/hierarchy/HierarchicalCommunicationController.java index 3efb9354128..cf94981d523 100644 --- a/flow-data/src/main/java/com/vaadin/flow/data/provider/hierarchy/HierarchicalCommunicationController.java +++ b/flow-data/src/main/java/com/vaadin/flow/data/provider/hierarchy/HierarchicalCommunicationController.java @@ -287,7 +287,7 @@ private void passivateInactiveKeys(Set oldActive, } // Finally clear any passivated items that have now been confirmed - oldActive.removeAll(newActiveKeyOrder); + newActiveKeyOrder.forEach(oldActive::remove); if (!oldActive.isEmpty()) { passivatedByUpdate.put(Integer.valueOf(updateId), oldActive); }