Refine `LoaderIntegrationTests` to fix failures when CI builds are running with later JDK versions. See gh-29385