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