void () { String docText = """ /** * Hello {@link #foo}, * here's an asterisk: * * and some {@code code}. * tags1 <unknownTag>this<unknownTag>is</unknownTag>unknown</unknownTag > * tags2 <unknown1>one<unknown2>unknown<unknown1>unknown</unknown2> two<p/> three<unknown1/> four</unknown1> * {@link #unknown} is unknown. * @param foo the text without the parameter name * @return the offset of {@link #bar} in something * @throws Exception when something happens */"""; TextContent text = extractText("a.java", docText, 6); assertEquals("Hello |,\nhere's an asterisk: *\nand some |.\ntags1 |\ntags2 |\n|is unknown.", unknownOffsets(text)); text = extractText("a.java", docText, docText.indexOf("the offset")); assertEquals("the offset of in something", text.toString()); text = extractText("a.java", docText, docText.indexOf("without")); assertEquals("the text without the parameter name", text.toString()); text = extractText("a.java", docText, docText.indexOf("when something")); assertEquals("when something happens", text.toString()); }