public static <E> FunctionExecutor<Void> createRemove(final FeatureDefinition<? extends Property<? extends Collection<E>>> propertyDefinition) {

        return new FunctionExecutor<Void>() {

            @Override
            public Void invoke(FunctionInvocation<Void> invocation, Object... arguments) throws ExecutorInvocationException {

                for (Object element : arguments) {
                    boolean changed = invocation.getHolder().get(propertyDefinition).get().remove(element);

                    // Set the parent of the removed element to null
                    if (changed && element instanceof ChildFeatureHolder) {
                        ((ChildFeatureHolder<?>) element).setParent(null);
                    }
                }

                return invocation.next(arguments);
            }

        };
    }