I need check with junit that method of nested anonymous class invoked. But this class is private. Does there exist a way to test it without changing visiblity and logic of work? It may be that a common way exists to resolve similar problems?
Share
The fact that the class is private or anonymous means that the implementation details are private. In general, your tests should not be depending upon implementation details, but should be testing behaviour, not the specific implementation.