code: private GenPackage findGenPackageByNsURI(GenModel genModel, String nsURI) {
  		List<GenPackage> allGenPackages = genModel.getAllGenUsedAndStaticGenPackagesWithClassifiers();
  		for(GenPackage genPackage: allGenPackages) {
  			EPackage ecorePackage = genPackage.getEcorePackage();
  			if (ecorePackage == null || ecorePackage.eIsProxy()) {
  				throw new RuntimeException("Unresolved proxy: " + ecorePackage + " in " + genModel.eResource().getURI());
  			}
  			if (nsURI.equals(ecorePackage.getNsURI())) {
  				return genPackage;
  			}
  		}
  		throw new RuntimeException("No GenPackage for NsURI " + nsURI + " found in " + genModel.eResource().getURI());
  	}
docs: /*
  Adopted from GenModel#findGenPackageHelper