AtomSuppression { static AtomSuppression anyHydrogens() { return anyHydrogens; }    }
@Test public void anyHydrogens() throws Exception { AtomSuppression suppression = AtomSuppression.anyHydrogens(); IAtomContainer container = mock(IAtomContainer.class); when(container.getAtomCount()).thenReturn(5); IAtom carbon = mock(IAtom.class); IAtom hydrogen = mock(IAtom.class); when(carbon.getSymbol()).thenReturn("C"); when(hydrogen.getSymbol()).thenReturn("H"); when(container.getAtom(0)).thenReturn(carbon); when(container.getAtom(1)).thenReturn(hydrogen); when(container.getAtom(2)).thenReturn(carbon); when(container.getAtom(3)).thenReturn(carbon); when(container.getAtom(4)).thenReturn(hydrogen); Suppressed suppressed = suppression.suppress(container); assertFalse(suppressed.contains(0)); assertTrue(suppressed.contains(1)); assertFalse(suppressed.contains(2)); assertFalse(suppressed.contains(3)); assertTrue(suppressed.contains(4)); }