code: @SuppressWarnings("unchecked")
     private <F extends FACETTYPE> F safeGetFacet(Class<F> type)
  
     {
        for (FACETTYPE facet : facets)
        {
           if (type.isInstance(facet))
           {
              return (F) facet;
           }
        }
        return null;
     }
docs: Returns the installed facet that is an instance of the provided type argument, null otherwise.
  
  It does not throw any exception
  
  @param type the facet type
  @return the Facet if found, otherwise, null