### Question:
AntTargetNote extends ConsoleNote { @Override public ConsoleAnnotator annotate(Object context, MarkupText text, int charPos) { if (!ENABLED) { return null; } MarkupText.SubText t = text.findToken(Pattern.compile(".*(?=:)")); if (t != null) { t.addMarkup(0, t.length(), "<b class=ant-target>", "</b>"); } return null; } AntTargetNote(); @Override ConsoleAnnotator annotate(Object context, MarkupText text, int charPos); static boolean ENABLED; }### Answer:
@Test public void testAnnotateTarget() { assertEquals("<b class=ant-target>TARGET</b>:", annotate("TARGET:")); }
@Test public void testAnnotateTargetContainingColon() { assertEquals("<b class=ant-target>TEST:TARGET</b>:", annotate("TEST:TARGET:")); }
@Test public void testDisabled() { AntTargetNote.ENABLED = false; assertEquals("TARGET:", annotate("TARGET:")); }