code: public static EntityType newInstance(
        EntityType entityType, AttributeCopyMode attrCopyMode, AttributeFactory attrFactory) {
      EntityType entityTypeCopy = new EntityType(entityType.getEntityType()); // do not deep-copy
      entityTypeCopy.setId(entityType.getId());
      entityTypeCopy.setPackage(entityType.getPackage()); // do not deep-copy
      entityTypeCopy.setLabel(entityType.getLabel());
      entityTypeCopy.setDescription(entityType.getDescription());
  
      // Own attributes (deep copy or shallow copy)
      if (attrCopyMode == DEEP_COPY_ATTRS) {
        deepCopyAttributes(entityType, entityTypeCopy, attrFactory);
      } else {
        entityTypeCopy.setOwnAllAttributes(newArrayList(entityType.getOwnAllAttributes()));
      }
  
      entityTypeCopy.setAbstract(entityType.isAbstract());
      entityTypeCopy.setExtends(entityType.getExtends()); // do not deep-copy
      entityTypeCopy.setTags(newArrayList(entityType.getTags())); // do not deep-copy
      entityTypeCopy.setBackend(entityType.getBackend());
      entityTypeCopy.setIndexingDepth(entityType.getIndexingDepth());
  
      return entityTypeCopy;
    }
docs: Copy-factory (instead of copy-constructor to avoid accidental method overloading to {@link
  #EntityType(EntityType)}). Creates shallow-copy of package, tags and extended entity.
  
  @param entityType entity meta data
  @param attrCopyMode attribute copy mode that defines whether to deep-copy or shallow-copy
  attributes
  @param attrFactory attribute factory used to create new attributes in deep-copy mode
  @return copy of entity meta data