/**
  * Returns a boolean indicating whether the neutral losses of the given fragment ion fit the
  * requirement of the given neutral losses map.
  *
  * @param neutralLosses map of expected neutral losses: neutral loss
  * @param theoreticIon the ion of interest
  * @return a boolean indicating whether the neutral losses of the given fragment ion are fit the
  *     requirement of the given neutral losses map
  */
 public boolean lossesValidated(NeutralLossesMap neutralLosses, Ion theoreticIon) {
   if (theoreticIon.hasNeutralLosses()) {
     for (NeutralLoss neutralLoss : theoreticIon.getNeutralLosses()) {
       if (!isAccounted(neutralLosses, neutralLoss, theoreticIon)) {
         return false;
       }
     }
   }
   return true;
 }