### Question:
StringUtils extends org.springframework.util.StringUtils { public static String getArtifactId(String jarShotName) { if (null == jarShotName || "".equals(jarShotName)) { return jarShotName; } String regex = "(-\\d+)(\\.\\d+)*(-SNAPSHOT)?(\\.\\S+)?$"; return jarShotName.replaceAll(regex, ""); }  static String getSeparator(); static String getFileDirectory(String filePath); static String getPatternRoot(String pattern); static String getArtifactId(String jarShotName); static String formatBySpace(String formatString, int digit, boolean front);  }### Answer:
@Test public void testGetArtifactId() { String[] strs = { "mysql-connector-java-5.1.12.jar", "junit-4.8.2.jar", "bi-basic-2.0.0-SNAPSHOT.jar", "spring-aop-3.1.0.RELEASE.jar", "jetty-server-7.5.4.v20111024.jar", "bi-jta-2.0.0-20120406.065642-2.jar"}; for (String string : strs) { System.out.println("testGetArtifactId(): " + string + " <==> " + StringUtils.getArtifactId(string)); } }