2016-08-23 18:05 GMT+03:00 Lauri Kenttä <lauri.ken...@gmail.com>: > Could you do it without reflection, then? I don't think so. > Thus, I think your "use case" is broken by design. >
FYI: This use case is used by Go! AOP Framework and AspectMock libraries that can mock even static methods in the classes, allowing testing legacy code and singletons. If you are interested in how it works, then you could look at this example: https://3v4l.org/TbS5V