BasicAtomGenerator implements IGenerator<IAtomContainer> { protected boolean invisibleHydrogen(IAtom atom, RendererModel model) { return isHydrogen(atom) && !(Boolean) model.get(ShowExplicitHydrogens.class); } BasicAtomGenerator(); @Override IRenderingElement generate(IAtomContainer container, RendererModel model); IRenderingElement generate(IAtomContainer atomContainer, IAtom atom, RendererModel model); IRenderingElement generateCompactElement(IAtom atom, RendererModel model); AtomSymbolElement generateElement(IAtom atom, int alignment, RendererModel model); @Override List<IGeneratorParameter<?>> getParameters();  }
@Test public void invisibleHydrogenTest() { IAtom hydrogen = super.builder.newInstance(IAtom.class, "H"); model.set(ShowExplicitHydrogens.class, false); Assert.assertTrue(generator.invisibleHydrogen(hydrogen, model)); model.set(ShowExplicitHydrogens.class, true); Assert.assertFalse(generator.invisibleHydrogen(hydrogen, model)); IAtom nonHydrogen = super.builder.newInstance(IAtom.class, "C"); model.set(ShowExplicitHydrogens.class, false); Assert.assertFalse(generator.invisibleHydrogen(nonHydrogen, model)); model.set(ShowExplicitHydrogens.class, true); Assert.assertFalse(generator.invisibleHydrogen(nonHydrogen, model)); }