During testing of the shared libraries it's really useful to be able to intercept the calls.
Reason:
All the current implementations of the Jenkins Shared Libraries unit tests are quite useless - there are a number of issues impossible to test outside of actual workflow-cps-plugin. We have the next issue about that: JENKINS-33925.