if (result != null && facetTypes != null)
{
for (Class<? extends ProjectFacet> facetType : facetTypes)
{
ProjectFacet facet = factory.create(facetType, result);
if (!result.install(facet))
{
throw new IllegalStateException("Could not install Facet [" + facet + "] of type [" + facetType
+ "] into Project [" + result + "]");
}