Getting the group (X,Y) position/location BEFORE it is collapsed

I would like to get the group (X,Y) position/location BEFORE it is collapsed, in order to set the group position/location after it is collapsed.
Namely, when a group is collapsed, i understand that the handler is called after the group is collapsed.
I would like to keep the group (X,Y) before it is collapsed and use it the collapse command handler in order to set group position/location.
I hope i’m clear…

I suppose it is possible to override CommandHandler.collapseSubGraph, but there can be many nested groups that might be collapsed.

I tested the subGraphExpandedChanged function and it does contain the group position BEFORE it is collapsed. Looks good.