String (@NotNull Document document, @NotNull GradleVersion gradleVersion) { String scope = firstOrEmpty(document.getElementsByTagName("scope")); boolean isSupportedImplementation = GradleUtil.isSupportedImplementationScope(gradleVersion); return switch (scope) { case "test" -> isSupportedImplementation ? "testImplementation" : "testCompile"; case "provided" -> "compileOnly"; case "runtime" -> "runtime"; case "compile" -> isSupportedImplementation ? "implementation" : "compile"; default -> isSupportedImplementation ? "implementation" : "compile"; }; }