TotalHCountAtom extends SMARTSAtom { @Override public String toString() { return "H" + totalHCount; } TotalHCountAtom(int totalHCount, IChemObjectBuilder builder); @Override boolean matches(final IAtom atom); @Override String toString();  }
@Test public void testToString() throws Exception { TotalHCountAtom total = new TotalHCountAtom(4, mock(IChemObjectBuilder.class)); assertThat(total.toString(), is("H4")); }