### Question:
ServerInfo { public String getVersion() { return rb.getString("git.build.version"); } ServerInfo();   ServerInfo(Properties props); String getVersion(); String getShortCommitId(); String getCommitMessage(); String getJava(); String getBranch(); @Override String toString(); String details();  }### Answer:
@Test public void testVersion() { String version = serverInfo.getVersion(); Pattern pattern = Pattern.compile("^(\\d+\\.\\d+\\.\\d+)(-.*)$"); Matcher matcher = pattern.matcher(version); assertTrue(matcher.matches(), "Unexpected format for :" + version); }