### Question:
TemplateParse { public List<String> parse(String template) { List<String> segments = new ArrayList<String>(); int index = collectSegments(template, segments, 0); addTail(segments, template, index); return segments; }  List<Segment> parseSegments(String template); List<String> parse(String template);  }### Answer:
@Test public void emptyTemplateRendersAsEmptyString() throws Exception { assertTrue(parse("").isEmpty()); }
@Test public void templateWithOnlyPlainText() throws Exception { List<String> segments = parse("plain text only"); assertSegments(segments, "plain text only"); }
@Test public void parsingMultipleVariables() throws Exception { List<String> segments = parse("${a}:${b}:${c}"); assertSegments(segments, "${a}", ":", "${b}", ":", "${c}"); }