You can use --add-exports to break encapsulation so that you can use an internal API whose default is to be inaccessible. Here is the syntax:
--add-exports <source-module>/<package>=<target-module>( ,<target-module>)*
This command-line option gives code in the <target-module> access to types in the <source-module> package.
Another method of breaking encapsulation is with a JAR file's manifest. Here is an example:
--add-exports:java.management/sun.management