code: protected static void setCurrentInstance(FacesContext context) {
  
          if (context == null) {
              instance.remove();
          } else {
              instance.set(context);
          }
  
      }
docs: <p>Set the {@link FacesContext} instance for the request that is
  being processed by the current thread.</p>
  
  @param context The {@link FacesContext} instance for the current
  thread, or <code>null</code> if this thread no longer has a
  <code>FacesContext</code> instance.