CompoundHighlighter extends AbstractHighlighter implements UIDependent { @Override public void updateUI() { for (Highlighter highlighter : highlighters) { updateUI(highlighter); } } CompoundHighlighter(Highlighter... inList);  CompoundHighlighter(HighlightPredicate predicate, Highlighter... inList); void setHighlighters(Highlighter... inList); void addHighlighter(Highlighter highlighter); void addHighlighter(Highlighter highlighter, boolean prepend); void removeHighlighter(Highlighter hl); Highlighter[] getHighlighters(); @Override void updateUI(); static final Highlighter[] EMPTY_HIGHLIGHTERS; }
@Test public void testUpdateUI() { CompoundHighlighter support = new CompoundHighlighter(); ColorHighlighter colorHighlighter = (ColorHighlighter) HighlighterFactory.createSimpleStriping(); Color uiColor = UIManager.getColor("UIColorHighlighter.stripingBackground"); if (uiColor == null) { LOG.info("cannot run test - no ui striping color"); return; } assertSame("sanity", uiColor, colorHighlighter.getBackground()); support.addHighlighter(colorHighlighter); Color changedUIColor = Color.RED; UIManager.put("UIColorHighlighter.stripingBackground", changedUIColor); support.updateUI(); try { assertSame("support must update ui color", changedUIColor, colorHighlighter.getBackground()); } finally { UIManager.put("UIColorHighlighter.stripingBackground", uiColor); } }