void () { Collection<TopToolbarWrappers> values = myCommonActionsPlaceholder.values(); Stream<Wrapper> leftWrappers = values.stream().map(it -> it.left); Stream<Wrapper> rightWrappers = values.stream().map(it -> it.right); StreamEx.of(myToolbar).append(leftWrappers).append(rightWrappers) .map(Wrapper::getTargetComponent) .select(ActionToolbar.class) .distinct() .forEach(ActionToolbar::updateActionsImmediately); }