Make the package-private method and the test will be able to see it if the test is in the corresponding test package (the same package name as the production code).
@VisibleForTesting Address getAddress() { return mAddress; }
Also consider code refactoring, so you donโt need to explicitly check the private method, try checking the behavior of the open interface. Code that is difficult to verify may indicate that production code can be improved.
An annotation point is its agreement and can be used in the analysis of static code, while a comment cannot be.
Mikej
source share