code: protected MetadataViewKey deriveViewKey(FacesContext facesContext,
                      UIViewRoot root)
      {
          MetadataViewKey viewKey; 
          if (!facesContext.getResourceLibraryContracts().isEmpty())
          {
              String[] contracts = new String[facesContext.getResourceLibraryContracts().size()];
              contracts = facesContext.getResourceLibraryContracts().toArray(contracts);
              viewKey = new MetadataViewKeyImpl(root.getViewId(), root.getRenderKitId(), root.getLocale(), contracts);
          }
          else
          {
              viewKey = new MetadataViewKeyImpl(root.getViewId(), root.getRenderKitId(), root.getLocale());
          }
          return viewKey;
      }
docs: Generates an unique key according to the metadata information stored
  in the passed UIViewRoot instance that can affect the way how the view is generated.
  By default, the "view" params are the viewId, the locale, the renderKit and
  the contracts associated to the view.
  
  @param facesContext
  @param root
  @return