code: public static IMolecularFormula getMostAbundant(IMolecularFormula mf) {
          final Isotopes isofact;
          try {
              isofact = Isotopes.getInstance();
          } catch (IOException e) {
              return null;
          }
          IMolecularFormula res = mf.getBuilder()
                                    .newInstance(IMolecularFormula.class);
          for (IIsotope iso : mf.isotopes()) {
              int count = mf.getIsotopeCount(iso);
              if (iso.getMassNumber() == null || iso.getMassNumber() == 0) {
                  IIsotope[] isotopes = isofact.getIsotopes(iso.getSymbol());
                  Arrays.sort(isotopes, NAT_ABUN_COMP);
                  if (!addIsotopeDist(res, isotopes, 0, count))
                      return null;
              } else
                  res.addIsotope(iso, count);
          }
          return res;
      }
docs: Compute the most abundant MF. Given the MF C<sub>6</sub>Br<sub>6</sub>
  this function rapidly computes the most abundant MF as
  <sup>12</sup>C<sub>6</sub><sup>79</sup>Br<sub>3</sub><sup>81
  </sup>Br<sub>3</sub>.
  
  @param mf a molecular formula with unspecified isotopes
  @return the most abundant MF, or null if it could not be computed