void (String text, String expected) { StringBuilder normalized = new StringBuilder(); int offset = text.indexOf(CARET_MARKER); normalized.append(text, 0, offset); normalized.append(text.substring(offset + CARET_MARKER.length())); CharSequence actual = AbstractBasicJavadocTypedHandler.getTagName(normalized.toString(), offset); assertEquals(expected, actual); }