final XShapes pageShapes = UnoRuntime.queryInterface( XShapes.class, getFirstPageShapes() );
pageShapes.add( shape );
// Sadly, Draw/Impress currently do not create Undo actions for programmatic changes to the document.
// Which renders the test here slightly useless ... unless we fake the Undo actions ourself.
final XUndoManagerSupplier suppUndoManager = UnoRuntime.queryInterface( XUndoManagerSupplier.class, getDocument().getDocument() );
final XUndoManager undoManager = suppUndoManager.getUndoManager();
undoManager.addUndoAction( new ShapeInsertionUndoAction( shape, pageShapes ) );
}