code: @SuppressWarnings({"unchecked", "rawtypes"})
      private InternalNode<?> combineIDDSameLevel(InternalNode n1,
                                                  InternalNode n2) throws MIDDException {
          if (n1.getID() != n2.getID()) {
              throw new IllegalArgumentException("Both params should have the same variable level at their root");
          }
  
          if (n1.getType() != n2.getType()) {
              throw new IllegalArgumentException("Both IDD roots should have the same data type");
          }
  
          Partition p1 = PartitionBuilder.createPartition(n1.getIntervals());
          Partition p2 = PartitionBuilder.createPartition(n2.getIntervals());
  
          Partition<?> p = PartitionBuilder.union(p1, p2);
          if (p.size() == 0) {
              log.error("Empty unioned partition");
              return null;
          }
  
          InternalNodeState newState = combineIndeterminateStates(n1.getState(), n2.getState());
  
          InternalNode<?> n = NodeUtils.createInternalNode(n1.getID(), newState, n1.getType());
  
          for (Interval<?> interval : p.getIntervals()) {
              AbstractNode op1 = n1.getChild(interval);
              AbstractNode op2 = n2.getChild(interval);
              AbstractNode child = null;
              if (op1 != null && op2 != null) {
                  child = combine(op1, op2);
              } else if (op1 != null || op2 != null) {
                  child = GenericUtils.newInstance(op1 == null ? op2 : op1);
              } else {
                  throw new RuntimeException("Error merging two partitions, " +
                          "the output partition has an item not belong to both previous ones");
              }
  
              if (child != null) {
                  AbstractEdge<?> edge = EdgeUtils.createEdge(interval, n.getType());
                  if (edge.getIntervals().size() == 0) {
                      throw new RuntimeException("Empty edge");
                  }
                  n.addChild(edge, child);
              }
          }
  
          return n;
      }
docs: Combine two MIDD with same level of attribute at their roots
  
  @param n1
  @param n2
  @return