code: static void transformRefEntities(EntityType entityType, Map<String, EntityType> newEntityTypes) {
      if (newEntityTypes.isEmpty()) {
        return;
      }
  
      stream(entityType.getAtomicAttributes())
          .filter(EntityTypeUtils::isReferenceType)
          .forEach(attr -> transformRefEntity(attr, newEntityTypes));
    }
docs: Changes all references of an {@link EntityType} to point to other, new EntityTypes. Does
  nothing for references whose IDs are not present in the supplied Map.
  
  @param entityType the EntityType to update
  @param newEntityTypes a Map of (old) EntityType IDs and new EntityTypes