MavenArtifactDescriptor { public static MavenArtifactDescriptor fromMscGav(String gav) throws IOException { String[] parts = gav.split(":"); if (parts.length == 3) { return new MavenArtifactDescriptor(parts[0], parts[1], parts[2]); } else if (parts.length == 4) { return new MavenArtifactDescriptor(parts[0], parts[1], "jar", parts[3], parts[2]); } else { throw new IOException("Invalid gav: " + gav); } } private  MavenArtifactDescriptor();  MavenArtifactDescriptor(String groupId, String artifactId, String version);  MavenArtifactDescriptor(String groupId, String artifactId, String type, String classifier, String version); static Builder build(); static MavenArtifactDescriptor fromMscGav(String gav); static MavenArtifactDescriptor fromMavenGav(String gav); @Override boolean equals(Object obj); @Override int hashCode(); String groupId(); String artifactId(); String version(); String classifier(); String type(); String mscGav(); ArtifactCoordinates mscCoordinates(); String mavenGav(); String repoPath(boolean forJar);  }
@Test public void testFromMscGav() throws IOException { MavenArtifactDescriptor desc = MavenArtifactDescriptor.fromMscGav("org.wildfly.swarm:container:1.0"); assertThat(desc.groupId()).isEqualTo("org.wildfly.swarm"); assertThat(desc.artifactId()).isEqualTo("container"); assertThat(desc.version()).isEqualTo("1.0"); assertThat(desc.type()).isEqualTo("jar"); assertThat(desc.classifier()).isNull(); assertThat(desc.mscGav()).isEqualTo("org.wildfly.swarm:container:1.0"); }