CompoundHighlighter extends AbstractHighlighter implements UIDependent { public void setHighlighters(Highlighter... inList) { Contract.asNotNull(inList, "Highlighter must not be null"); if (highlighters.isEmpty() && (inList.length == 0)) return; removeAllHighlightersSilently(); for (Highlighter highlighter : inList) { addHighlighterSilently(highlighter, false); } fireStateChanged(); } 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 testSetHighlightersNull() { CompoundHighlighter table = new CompoundHighlighter(); try { table.setHighlighters((Highlighter) null); fail("illegal to call setHighlighters(null)"); } catch (NullPointerException e) { } }
@Test public void testSetHighlightersWithNullArray() { CompoundHighlighter table = new CompoundHighlighter(); try { table.setHighlighters((Highlighter[]) null); fail("illegal to call setHighlighters(null)"); } catch (NullPointerException e) { } }
@Test public void testSetHighlightersArrayNullElement() { CompoundHighlighter table = new CompoundHighlighter(); try { table.setHighlighters(new Highlighter[] {null}); fail("illegal to call setHighlighters(null)"); } catch (NullPointerException e) { } }