code: private ImmutableSubstitution<VariableOrGroundTerm> updateSubstitution(
              final ImmutableSubstitution<VariableOrGroundTerm> accumulatedSubstitution,
              final DataAtom accumulatedAtom,  final DataAtom newAtom) throws AtomUnificationException {
          Optional<ImmutableSubstitution<VariableOrGroundTerm>> optionalSubstitution =
                  unificationTools.computeAtomMGU(accumulatedAtom, newAtom);
  
          if (optionalSubstitution.isPresent()) {
              if (accumulatedSubstitution.isEmpty()) {
                  return optionalSubstitution.get();
              }
              else {
                  Optional<ImmutableSubstitution<VariableOrGroundTerm>> optionalAccumulatedSubstitution =
                          unificationTools.computeAtomMGUS(accumulatedSubstitution, optionalSubstitution.get());
                  if (optionalAccumulatedSubstitution.isPresent()) {
                      return optionalAccumulatedSubstitution.get();
                  }
                  /*
                   * Cannot unify the two substitutions
                   */
                  else {
                      // TODO: log a warning
                      throw new AtomUnificationException();
                  }
              }
          }
          /*
           * Cannot unify the two atoms
           */
          else {
              // TODO: log a warning
              throw new AtomUnificationException();
          }
      }
docs: TODO: explain