GroupArtifactVersion { public boolean isSnapshot() { return getVersion() != null && getVersion().endsWith("SNAPSHOT"); } GroupArtifactVersion(String groupId, String artifactId, String version); String getGroupId(); String getArtifactId(); String getVersion(); boolean isSnapshot(); String getSanitizedArtifactId();  }
@Test public void checkSnapshot() { Object[] data = new Object[] { "1.0-SNAPSHOT", true, "1.2.3", false, "4.2-GA", false }; for (int i = 0; i < data.length; i+=2) { GroupArtifactVersion gav = new GroupArtifactVersion("group", "artifact", (String) data[i]); assertThat(gav.isSnapshot()).isEqualTo(data[i+1]); } }