OrderRootsEnumerator (OrderEnumerator enumerator, int classPathType, Sdk jdk) { if ((classPathType & INCLUDE_PROVIDED) == 0) { enumerator = enumerator.runtimeOnly(); } if ((classPathType & JDK_ONLY) == 0) { enumerator = enumerator.withoutSdk(); } if ((classPathType & TESTS_ONLY) == 0) { enumerator = enumerator.productionOnly(); } OrderRootsEnumerator rootsEnumerator = enumerator.classes(); if ((classPathType & JDK_ONLY) != 0) { rootsEnumerator = rootsEnumerator.usingCustomSdkRootProvider(entry -> jdkRoots(jdk)); } return rootsEnumerator; }