### Question:
ServerInfo { public String details() { StringBuilder details = new StringBuilder(); details.append("LemMinX Server info:"); append(details, "Version", getVersion()); append(details, "Java", getJava()); append(details, "Git", null); String branch = getBranch(); if (!MASTER.equals(branch)) { details.append(" [Branch ") .append(branch) .append("]"); } details.append(" ") .append(getShortCommitId()) .append(" - ") .append(getCommitMessage()); return details.toString(); } ServerInfo();   ServerInfo(Properties props); String getVersion(); String getShortCommitId(); String getCommitMessage(); String getJava(); String getBranch(); @Override String toString(); String details();  }### Answer:
@Test public void testDetails() { String details = serverInfo.details(); assertTrue(details.contains(serverInfo.getVersion()), "version is missing from the details"); assertTrue(details.contains(serverInfo.getJava()), "Java is missing from the details"); assertTrue(details.contains(serverInfo.getCommitMessage()), "commit message is missing from the details"); assertTrue(details.contains(serverInfo.getShortCommitId()), "commit id is missing from the details"); String branch = serverInfo.getBranch(); if (ServerInfo.MASTER.equals(branch)) { assertFalse(details.contains(branch), "master branch should not be in the details"); } else { assertTrue(details.contains(branch), branch + " branch is missing from the details"); } }