code: private ValidationReport validateBondOrderSum(IAtom atom, IAtomContainer molecule) {
          ValidationReport report = new ValidationReport();
          ValidationTest checkBondSum = new ValidationTest(atom, "The atom's total bond order is too high.");
          try {
              AtomTypeFactory structgenATF = AtomTypeFactory.getInstance(
                      "org/openscience/cdk/dict/data/cdk-atom-types.owl", atom.getBuilder());
              int bos = (int) molecule.getBondOrderSum(atom);
              IAtomType[] atomTypes = structgenATF.getAtomTypes(atom.getSymbol());
              if (atomTypes.length == 0) {
                  checkBondSum.setDetails("Cannot validate bond order sum for atom not in valency atom type list: "
                          + atom.getSymbol());
                  report.addWarning(checkBondSum);
              } else {
                  IAtomType failedOn = null;
                  boolean foundMatchingAtomType = false;
                  for (int j = 0; j < atomTypes.length; j++) {
                      IAtomType type = atomTypes[j];
                      if (Objects.equals(atom.getFormalCharge(), type.getFormalCharge())) {
                          foundMatchingAtomType = true;
                          if (bos == type.getBondOrderSum()) {
                              // skip this atom type
                          } else {
                              failedOn = atomTypes[j];
                          }
                      }
                  }
                  if (foundMatchingAtomType) {
                      report.addOK(checkBondSum);
                  } else {
                      if (failedOn != null) {
                          checkBondSum.setDetails("Bond order exceeds the one allowed for atom " + atom.getSymbol()
                                  + " for which the total bond order is " + failedOn.getBondOrderSum());
                      }
                      report.addError(checkBondSum);
                  }
              }
          } catch (Exception exception) {
              logger.error("Error while performing atom bos validation: ", exception.getMessage());
              logger.debug(exception);
          }
          return report;
      }
docs: the Molecule tests