The readability and accessibility constraints pose new and interesting problems when it comes to testing in Java 9. Let's look back at the way we've always been unit testing code in Java. Here are two common practices:
- The unit test code typically resides in a separate source folder that is added to the classpath. This is to separate the test code from the actual application code and to also make it easy to exclude the test folder when building an application for deployment.
- The unit test classes typically share the same package as the class under test. This is to make sure the test classes can access the package-private members of the classes under test, even though they are in a completely different location.
These two design decisions work well when classes are in the classpath, because we know that the physical location of the classes...