@Test void printDescriptionPrintsEntriesSeparatedByComma() { ApiEntry inner1 = new ApiEntry() { @Override protected void createDescription(StringBuilder builder) { builder.append("desc"); } }; TestApiEntry apiEntry = new TestApiEntry(inner1, inner1); StringBuilder builder = new StringBuilder(); apiEntry.createDescription(builder); assertThat(builder.toString()).matches("\"\\d\":desc,\"\\d\":desc"); }
protected void createDescription(StringBuilder builder) { boolean prependComma = false; for(String name : entries.keySet()) { if(prependComma) { builder.append(","); } builder.append("\"").append(name).append("\":"); entries.get(name).createDescription(builder); prependComma = true; } }
ApiEntry { protected void createDescription(StringBuilder builder) { boolean prependComma = false; for(String name : entries.keySet()) { if(prependComma) { builder.append(","); } builder.append("\"").append(name).append("\":"); entries.get(name).createDescription(builder); prependComma = true; } } }
ApiEntry { protected void createDescription(StringBuilder builder) { boolean prependComma = false; for(String name : entries.keySet()) { if(prependComma) { builder.append(","); } builder.append("\"").append(name).append("\":"); entries.get(name).createDescription(builder); prependComma = true; } }  }
ApiEntry { protected void createDescription(StringBuilder builder) { boolean prependComma = false; for(String name : entries.keySet()) { if(prependComma) { builder.append(","); } builder.append("\"").append(name).append("\":"); entries.get(name).createDescription(builder); prependComma = true; } }   }
ApiEntry { protected void createDescription(StringBuilder builder) { boolean prependComma = false; for(String name : entries.keySet()) { if(prependComma) { builder.append(","); } builder.append("\"").append(name).append("\":"); entries.get(name).createDescription(builder); prependComma = true; } }    }