code: public static boolean hasMetadata(UIViewRoot root) {
          boolean result = false;
          
          UIComponent metadataFacet = root.getFacet(UIViewRoot.METADATA_FACET_NAME);
          if (null != metadataFacet) {
              result = 0 < metadataFacet.getChildCount();
          }
          
          return result;
      }
docs: <p class="changed_added_2_2">Utility method to determine if the
  the provided {@link UIViewRoot} has metadata.  The default implementation will
  return true if the provided {@code UIViewRoot} has a facet
  named {@link UIViewRoot#METADATA_FACET_NAME} and that facet has children.
  It will return  false otherwise.</p>
  
  @param root the {@link UIViewRoot} from which the metadata will
  be extracted from
  
  @return true if the view has metadata, false otherwise.