@Nullable
  public PackagingElement<?> moveChild(int index, int direction) {
    return this.update(
      () -> myMove(index, direction, myChildren),
      (builder, packagingElementEntity) -> {
        CompositePackagingElementEntity entity = (CompositePackagingElementEntity)packagingElementEntity;
        ArrayList<PackagingElementEntity> children = new ArrayList<>(ContainerUtil.collect(entity.getChildren().iterator()));
        PackagingElementEntity entityToReturn = myMove(index, direction, children);

        //noinspection unchecked
        builder.modifyEntity(CompositePackagingElementEntity.Builder.class, entity, o -> {
          //noinspection unchecked
          o.setChildren(ContainerUtil.map(children, x -> getBuilder(builder, x)));
          return Unit.INSTANCE;
        });

        if (entityToReturn == null) {
          return null;
        }
        MutableExternalEntityMapping<PackagingElement<?>> mapping = builder.getMutableExternalMapping(PackagingExternalMapping.key);
        PackagingElement<?> objectToReturn = mapping.getDataByEntity(entityToReturn);
        if (objectToReturn == null) {
          return myPackagingElementInitializer.initialize(entityToReturn, myProject, builder);
        }
        return objectToReturn;
      }
    );
  }
@Nullable
  public PackagingElement<?> moveChild(int index, int direction)