### Question:
MavenUtil { static String mvnToAether(String name) { Matcher m = mvnPattern.matcher(name); if (!m.matches()) { return name; } StringBuilder b = new StringBuilder(); b.append(m.group(1)).append(":"); b.append(m.group(2)).append(":"); String extension = m.group(5); String classifier = m.group(7); if (present(classifier)) { if (present(extension)) { b.append(extension).append(":"); } else { b.append("jar:"); } b.append(classifier).append(":"); } else { if (present(extension) && !"jar".equals(extension)) { b.append(extension).append(":"); } } b.append(m.group(3)); return b.toString(); }    }### Answer:
@Test public void testMvnToAether() throws Exception { assertEquals("org.foo:org.foo.bar:1.0-SNAPSHOT", mvnToAether("mvn:org.foo/org.foo.bar/1.0-SNAPSHOT")); assertEquals("org.foo:org.foo.bar:kar:1.0-SNAPSHOT", mvnToAether("mvn:org.foo/org.foo.bar/1.0-SNAPSHOT/kar")); assertEquals("org.foo:org.foo.bar:xml:features:1.0-SNAPSHOT", mvnToAether("mvn:org.foo/org.foo.bar/1.0-SNAPSHOT/xml/features")); }