DependencyResolver { public static Collection<String> inferScalaVersion(Collection<String> artifact) { List<String> list = new LinkedList<String>(); for (String a : artifact) { list.add(inferScalaVersion(a)); } return list; } DependencyResolver(SparkIMain intp, SparkContext sc, String localRepoPath,
                            String additionalRemoteRepository); void addRepo(String id, String url, boolean snapshot); RemoteRepository delRepo(String id); List<String> load(String artifact,
      boolean addSparkContext); List<String> load(String artifact, Collection<String> excludes,
      boolean addSparkContext); List<ArtifactResult> getArtifactsWithDep(String dependency,
      Collection<String> excludes); static Collection<String> inferScalaVersion(Collection<String> artifact); static String inferScalaVersion(String artifact);  }
@Test public void testInferScalaVersion() { String [] version = scala.util.Properties.versionNumberString().split("[.]"); String scalaVersion = version[0] + "." + version[1]; assertEquals("groupId:artifactId:version", DependencyResolver.inferScalaVersion("groupId:artifactId:version")); assertEquals("groupId:artifactId_" + scalaVersion + ":version", DependencyResolver.inferScalaVersion("groupId::artifactId:version")); assertEquals("groupId:artifactId:version::test", DependencyResolver.inferScalaVersion("groupId:artifactId:version::test")); assertEquals("*", DependencyResolver.inferScalaVersion("*")); assertEquals("groupId:*", DependencyResolver.inferScalaVersion("groupId:*")); assertEquals("groupId:artifactId*", DependencyResolver.inferScalaVersion("groupId:artifactId*")); assertEquals("groupId:artifactId_" + scalaVersion, DependencyResolver.inferScalaVersion("groupId::artifactId")); assertEquals("groupId:artifactId_" + scalaVersion + "*", DependencyResolver.inferScalaVersion("groupId::artifactId*")); assertEquals("groupId:artifactId_" + scalaVersion + ":*", DependencyResolver.inferScalaVersion("groupId::artifactId:*")); }