Therefore, I am interested in the method of its implementation. Basically: how can I implement the same thing again? ... which I am not going to do. Just get it.
The main question: How can (?) Generally intercept an instance of a class? And how can it be replaced in one case by one implementation and in another case with the original or even another implementation?
How can you intercept static methods or private classes.
It's all about gaskets / roles, not so much about plugs.
source share