MolecularFormulaRange implements Cloneable { public void removeAllIsotopes() { isotopesMax.clear(); isotopesMin.clear(); } MolecularFormulaRange(); void addIsotope(IIsotope isotope, int countMin, int countMax); boolean contains(IIsotope isotope); int getIsotopeCountMax(IIsotope isotope); int getIsotopeCountMin(IIsotope isotope); int getIsotopeCount(); Iterable<IIsotope> isotopes(); void removeAllIsotopes(); void removeIsotope(IIsotope isotope); @Override Object clone();  }
@Test public void testRemoveAllIsotopes() { MolecularFormulaRange mfRange = new MolecularFormulaRange(); IIsotope carb = builder.newInstance(IIsotope.class, "C"); IIsotope flu = builder.newInstance(IIsotope.class, "F"); IIsotope h1 = builder.newInstance(IIsotope.class, "H"); mfRange.addIsotope(carb, 0, 10); mfRange.addIsotope(flu, 0, 10); mfRange.addIsotope(h1, 0, 10); mfRange.removeAllIsotopes(); Assert.assertEquals(0, mfRange.getIsotopeCount()); Assert.assertEquals(-1, mfRange.getIsotopeCountMin(carb)); Assert.assertEquals(-1, mfRange.getIsotopeCountMin(h1)); Assert.assertEquals(-1, mfRange.getIsotopeCountMin(flu)); }