code: static void transformPackage(EntityType entityType, Map<String, Package> newPackages) {
      if (newPackages.isEmpty()) {
        return;
      }
  
      Package entityTypePackage = entityType.getPackage();
      if (entityTypePackage != null) {
        String packageId = entityTypePackage.getId();
        if (newPackages.containsKey(packageId)) {
          entityType.setPackage(newPackages.get(packageId));
        }
      }
    }
docs: Changes the {@link Package} of an {@link EntityType} to another Package if it was present in
  the supplied Map. Does nothing if the Map does not contain the ID of the current Package.
  
  @param entityType the EntityType to update
  @param newPackages a Map of (old) Package IDs and new Packages