String (@NotNull String artifactCoordinates, @NotNull Predicate<String> artifactIdChecker) { String groupNameVersionCoordinates; String[] split = artifactCoordinates.split(":"); if (split.length == 4) { // group:name:packaging:classifier || name:packaging:classifier:version || group:name:classifier:version || group:name:packaging:version boolean isArtifactId = artifactIdChecker.test(split[1]); groupNameVersionCoordinates = isArtifactId ? split[0] + ":" + split[1] + ":" + split[3] : artifactCoordinates; } else if (split.length == 5) { // group:name:packaging:classifier:version groupNameVersionCoordinates = split[0] + ":" + split[1] + ":" + split[4]; } else { groupNameVersionCoordinates = artifactCoordinates; } return StringUtil.trimEnd(groupNameVersionCoordinates, ANDROID_LIBRARY_SUFFIX) + ":sources"; }