code: public static <S, I, O> boolean mergeADS(final ADTNode<S, I, O> parent, final ADTNode<S, I, O> child) {
  
          ADTNode<S, I, O> parentIter = parent, childIter = child;
  
          while (!(ADTUtil.isLeafNode(parentIter) || ADTUtil.isResetNode(parentIter)) && !ADTUtil.isLeafNode(childIter)) {
  
              if (!parentIter.getSymbol().equals(childIter.getSymbol())) {
                  return false;
              }
  
              final Map<O, ADTNode<S, I, O>> childSuccessors = childIter.getChildren();
  
              if (childSuccessors.size() != 1) {
                  throw new IllegalArgumentException("No single trace child");
              }
  
              final Map<O, ADTNode<S, I, O>> parentSuccessors = parentIter.getChildren();
  
              final Map.Entry<O, ADTNode<S, I, O>> childSuccessor = childSuccessors.entrySet().iterator().next();
              final O childOutput = childSuccessor.getKey();
              final ADTNode<S, I, O> childADS = childSuccessor.getValue();
  
              if (!parentSuccessors.containsKey(childOutput)) {
                  parentSuccessors.put(childOutput, childADS);
                  childADS.setParent(parentIter);
                  return true;
              }
  
              parentIter = parentSuccessors.get(childOutput);
              childIter = childADS;
          }
  
          return false;
      }
docs: Tries to merge the given (single trace) ADSs (which only contains one leaf) into the given parent ADSs. If
  possible, the parent ADS is altered as a side-effect
  
  @param parent
  the parent ADS in which the given child ADS should be merged into
  @param child
  the (single trace) ADS which should be incorporated into the parent ADS.
  @param <S>
  (hypothesis) state type
  @param <I>
  input alphabet type
  @param <O>
  output alphabet type
  
  @return {@code true} if ADSs could be merged, {@code false} otherwise