class CaseManagementContainmentControl implements WiresContainmentControl {

    @Override
    public void onMoveStart(double x, double y) {

        containmentControl.onMoveStart(x, y);
        if (!(getShape() instanceof CaseManagementShapeView)) {
            state.setGhost(Optional.empty());
            state.setOriginalIndex(OptionalInt.empty());
            state.setOriginalParent(Optional.empty());
            return;
        }

        state.setOriginalParent(Optional.ofNullable(getParent()));
        state.setOriginalIndex(getShapeIndex());
        state.setGhost(Optional.ofNullable(((CaseManagementShapeView) getShape()).getGhost()));

        final WiresLayerIndex index = containmentControl.getParentPickerControl().getIndex();
        if (state.getGhost().isPresent()) {
            index.exclude(state.getGhost().get());
        }

        if ((getParent() instanceof CaseManagementShapeView)) {
            ((CaseManagementShapeView) getParent()).logicallyReplace((CaseManagementShapeView) getShape(),
                                                                     state.getGhost().get());
        }
    }

    public  CaseManagementContainmentControl(final WiresParentPickerControl parentPickerControl,
                                            final CaseManagementContainmentStateHolder state);
      CaseManagementContainmentControl(final WiresContainmentControlImpl containmentControl,
                                     final CaseManagementContainmentStateHolder state);

}