code: public static MolecularFormulaRange getRange(IMolecularFormulaSet mfSet) {
          MolecularFormulaRange mfRange = new MolecularFormulaRange();
  
          for (IMolecularFormula mf : mfSet.molecularFormulas()) {
              for (IIsotope isotope : mf.isotopes()) {
                  int occur_new = mf.getIsotopeCount(isotope);
                  if (!mfRange.contains(isotope)) {
                      mfRange.addIsotope(isotope, occur_new, occur_new);
                  } else {
                      int occur_old_Max = mfRange.getIsotopeCountMax(isotope);
                      int occur_old_Min = mfRange.getIsotopeCountMin(isotope);
                      if (occur_new > occur_old_Max) {
                          mfRange.removeIsotope(isotope);
                          mfRange.addIsotope(isotope, occur_old_Min, occur_new);
                      } else if (occur_new < occur_old_Min) {
                          mfRange.removeIsotope(isotope);
                          mfRange.addIsotope(isotope, occur_new, occur_old_Max);
                      }
                  }
              }
          }
          // looking for those Isotopes which are not contained which then should be 0.
          for (IMolecularFormula mf : mfSet.molecularFormulas()) {
              if (mf.getIsotopeCount() != mfRange.getIsotopeCount()) {
                  for (IIsotope isotope : mfRange.isotopes()) {
                      if (!mf.contains(isotope)) {
                          int occurMax = mfRange.getIsotopeCountMax(isotope);
                          mfRange.addIsotope(isotope, 0, occurMax);
                      }
                  }
              }
          }
          return mfRange;
      }
docs: Extract from a set of MolecularFormula the range of each each element found and
  put the element and occurrence in a new MolecularFormulaRange.
  
  @param mfSet    The set of molecularFormules to inspect
  @return         A MolecularFormulaRange containing range occurrence of the elements