### Question:
FollowsNamedTypeBlockParser extends AcceptableJavadocBlockParser { @Override public IrDocBlock parse(String tag, JavadocScanner scanner) throws JavadocParseException { ArrayList<IrDocFragment> fragments = new ArrayList<>(); IrDocNamedType namedType = fetchNamedType(scanner); if (namedType != null) { fragments.add(namedType); } fragments.addAll(fetchRestFragments(scanner)); fragments.trimToSize(); return newBlock(tag, fragments); } FollowsNamedTypeBlockParser(String...tagNames); @Override IrDocBlock parse(String tag, JavadocScanner scanner);  }### Answer:
@Test public void testParseJust() throws Exception { FollowsNamedTypeBlockParser parser = new FollowsNamedTypeBlockParser("throws"); IrDocBlock block = parser.parse("throws", string("IllegalArgumentException")); assertEquals("@throws", block.getTag()); List<? extends IrDocFragment> fragments = block.getFragments(); assertKinds(fragments, NAMED_TYPE); assertEquals("IllegalArgumentException", ((IrDocNamedType) fragments.get(0)).getName().asString()); }
@Test public void testParseTrails() throws Exception { FollowsNamedTypeBlockParser parser = new FollowsNamedTypeBlockParser("throws"); IrDocBlock block = parser.parse("throws", string(" IllegalArgumentException nullpo")); assertEquals("@throws", block.getTag()); List<? extends IrDocFragment> fragments = block.getFragments(); assertKinds(fragments, NAMED_TYPE, TEXT); assertEquals("IllegalArgumentException", ((IrDocNamedType) fragments.get(0)).getName().asString()); assertTextEquals(" nullpo", fragments.get(1)); }
@Test public void testParseMissing() throws Exception { FollowsNamedTypeBlockParser parser = new FollowsNamedTypeBlockParser("throws"); IrDocBlock block = parser.parse("throws", string(" /IllegalArgumentException")); assertEquals("@throws", block.getTag()); List<? extends IrDocFragment> fragments = block.getFragments(); assertKinds(fragments, TEXT); assertTextEquals(" /IllegalArgumentException", fragments.get(0)); }