code: public Archetype flatten(@Nullable Archetype flatParent, Archetype differential) {
          checkArgument(flatParent == null || !flatParent.isIsDifferential(), "flatParent: Flat parent must be a flat archetype or null");
          checkArgument(differential.isIsDifferential(), "differential: Can only flatten a differential archetype");
  
          Archetype result = createFlatArchetypeClone(differential);
  
          if (differential.getParentArchetypeId() != null) {
              if (flatParent == null || !flatParent.getArchetypeId().getValue().startsWith(differential.getParentArchetypeId().getValue())) {
                  throw new AdlFlattenerException(String.format("Wrong or missing parent archetype: expected %s, got %s",
                          differential.getParentArchetypeId().getValue(),
                          flatParent != null ? flatParent.getArchetypeId().getValue() : null));
              }
              merger.merge(flatParent, result);
          }
  
          return result;
      }
docs: Flattens a specialized source archetype
  
  @param flatParent   Parent archetype. Must already be flattened. Can be null if differentialArchetype is not specialized
  @param differential Differential (source) archetype
  @return Specialized archetype in flattened form