class CaseManagementSetChildNodeGraphCommand extends AbstractGraphCommand {

    @SuppressWarnings("unchecked")
    void resizeNodes() {
        if (isStageNode(parent) && isSubStageNode(child)) {
            final List<Node> childNodes = parent.getOutEdges().stream()
                    .filter(childPredicate()).map(Edge::getTargetNode).collect(Collectors.toList());

            childNodes.stream().forEach(cNode -> {
                final Bounds cBounds = ((Node<View, Edge>) cNode).getContent().getBounds();
                originalBounds.put(cNode.getUUID(),
                                   Optional.of(Bounds.create(cBounds.getUpperLeft().getX(), cBounds.getUpperLeft().getY(),
                                                             cBounds.getLowerRight().getX(), cBounds.getLowerRight().getY())));
            });

            IntStream.range(0, childNodes.size()).forEach(i -> {
                final Node<View, Edge> childNode = childNodes.get(i);

                final double cx = STAGE_GAP;
                final double cy = STAGE_GAP + (STAGE_GAP + CHILD_HEIGHT) * i;

                // set stage child bounds
                childNode.getContent().setBounds(
                        Bounds.create(cx, cy, cx + CHILD_WIDTH, cy + CHILD_HEIGHT));
            });

            Bounds pBounds = parent.getContent().getBounds();
            originalParentBounds = Optional.of(Bounds.create(pBounds.getUpperLeft().getX(), pBounds.getUpperLeft().getY(),
                                                             pBounds.getLowerRight().getX(), pBounds.getLowerRight().getY()));

            Bounds parentBounds = Bounds.create(pBounds.getUpperLeft().getX(),
                                                pBounds.getUpperLeft().getY(),
                                                pBounds.getUpperLeft().getX() + CHILD_WIDTH + STAGE_GAP * 2,
                                                pBounds.getUpperLeft().getY() + STAGE_GAP + (STAGE_GAP + CHILD_HEIGHT) * childNodes.size());
            parent.getContent().setBounds(parentBounds);
        }
    }

    public  CaseManagementSetChildNodeGraphCommand(final Node<View<?>, Edge> parent,
                                                  final Node<View<?>, Edge> child,
                                                  final OptionalInt index,
                                                  final Optional<Node<View<?>, Edge>> originalParent,
                                                  final OptionalInt originalIndex);

}