I searched and I found this question but please don't mark this question as "a duplicate" since that question has three answers: One is using a different tool that apparently is not available anymore (the question is from 2009), the third answer completely misread the question and does not answer it.
So my question is very simple: I have an application that catches (allegedly) when the OS is shutdown). How can I simulate a shutdown so as to debug the application?