### Question:
StringTemplate { public String getHtmlForFlag(FeatureFlags flag, String userName) { StringBuilder content = new StringBuilder(); if(userName == null) { content.append(getHtmlForUserFlag(flag, userName,null)); } String[] userNames = flagManager.getUsersForFlag(flag); if (userNames.length > 0) { for (String user : userNames) { if (userName == null || user.equals(userName)) { content.append(getHtmlForUserFlag(flag, userName, user)); } } } String inputString = ""; if(userName == null) { inputString = getInput(servletUri + "/" + flag); } return getDiv(content.toString(), inputString); } StringTemplate(FlagManager flagManager); void setServletUri(String servletUri); String getHtmlPage(String body); String getInput(String uri); String getDiv(String content, String inputString); String getLink(String uri, String description, String divClass, String linkText); String displayAllFlags(); String getHtmlForFlag(FeatureFlags flag, String userName); String getHtmlForUserFlag(FeatureFlags flag, String userName, String threadUserName);  }### Answer:
@Test public void testNoUser() { String actual = template.getHtmlForFlag(Flags.ONE, null); String expected = Utils.readRessource(this, "/expectedNoUser.html"); assertEquals("NoUser", expected, actual); }
@Test public void testUserBob() { String actual = template.getHtmlForFlag(Flags.ONE, "bob"); String expected = Utils.readRessource(this, "/expectedUserDoesNotExist.html"); assertEquals("UserDoesNotExist", expected, actual); manager.flipFlagForUser("bob", Flags.ONE.name()); actual = template.getHtmlForFlag(Flags.ONE, "bob"); expected = Utils.readRessource(this, "/expectedUser.html"); assertEquals("User", expected, actual); }