void (@NotNull Collection<? extends PackagingElement<?>> children) { this.update( () -> myChildren.removeAll(children), (builder, packagingElementEntity) -> { MutableExternalEntityMapping<PackagingElement<?>> mapping = builder.getMutableExternalMapping("intellij.artifacts.packaging.elements"); children.stream() .map(o -> mapping.getFirstEntity(o)) .filter(Objects::nonNull) .forEach(o -> builder.removeEntity(o)); } ); }