### Question:
PropParser { public Prop parse(Tag tag) { String[] parts = tag.text().split(";", 3); if ((parts.length != 3) || Strings.containNullOrEmptyElement(parts)) { throw new RuntimeException("Invalid prop tag format '" + tag.text() + "', expected format @prop [name]; [supported type description]; [two-way?]"); } return new Prop(parts[0], parts[1], parts[2]); }  Prop parse(Tag tag);  }### Answer:
@Test public void whenParseValidTags_thenSuccessful() { PropParser propParser = new PropParser(); Tag[] validTags = new Tag[] { tag("prop1; Type1, Type2, Type3; one-way, two-way"), tag("prop2; Type1; two-way"), tag("prop2; Type1; two-way; one-way; one-shot") }; for(Tag tag : validTags) { propParser.parse(tag); } }
@Test public void whenParseInvalidTags_thenFailed() { PropParser propParser = new PropParser(); Tag[] invalidTags = new Tag[] { tag("prop1; Type1, Type2, Type3"), tag("prop2; ; two-way; something else") }; for(Tag invalidTag : invalidTags) { try { propParser.parse(invalidTag); fail("expected invalid tag exception"); }catch(RuntimeException e){ } } }