Some tests in jdk/test build the whole library like this:
@build jdk.testlibrary.*
thus inheriting module dependencies of all classes within the library.
One particular example is these tests:
test/java/io/InputStream/ReadAllBytes.java
test/java/io/InputStream/ReadNBytes.java
which inherit dependencies on java.management module through jdk.testlibrary.InputArguments class
Another example is this:
jdk.testlibrary.ProcessTools.getProcessId() depends on java.management.
jdk.testlibrary.Utils.tryFindJvmPid(String) depends ProcessTools
jdk.testlibrary.OutputAnalyzer.asLines(String) depends on Utils
This makes all tests depending on OutputAnalyzer to depend on java.management.