SelectionVisibility extends SymbolVisibility { static boolean isSelected(IChemObject object, RendererModel model) { if (object.getProperty(StandardGenerator.HIGHLIGHT_COLOR) != null) return true; if (model.getSelection() != null) return model.getSelection().contains(object); return false; } private  SelectionVisibility(SymbolVisibility delegate, boolean showAll); static SymbolVisibility disconnected(SymbolVisibility visibility); static SymbolVisibility all(SymbolVisibility visibility); @Override boolean visible(IAtom atom, List<IBond> neighbors, RendererModel model);  }
@Test public void highlightIsSelected() { IChemObject chemObject = mock(IChemObject.class); when(chemObject.getProperty(StandardGenerator.HIGHLIGHT_COLOR)).thenReturn(Color.RED); assertTrue(SelectionVisibility.isSelected(chemObject, new RendererModel())); }