@Test
public void testMassNumberDisplayWithDefinedIsotopes() throws Exception {

    IsotopeFactory ifac = Isotopes.getInstance();
    IChemObjectBuilder bldr = SilentChemObjectBuilder.getInstance();
    IMolecularFormula mf = bldr.newInstance(IMolecularFormula.class);
    mf.addIsotope(ifac.getMajorIsotope("C"), 7);
    mf.addIsotope(ifac.getMajorIsotope("O"), 3);
    mf.addIsotope(ifac.getMajorIsotope("H"), 3);
    mf.addIsotope(ifac.getMajorIsotope("Br"), 1);
    mf.addIsotope(ifac.getIsotope("Br", 81), 1);
    Isotopes.clearMajorIsotopes(mf);
    assertThat(MolecularFormulaManipulator.getString(mf, false, false), is("C7H3Br2O3"));
    assertThat(MolecularFormulaManipulator.getString(mf, false, true), is("C7H3Br[81]BrO3"));
}