@Deprecated
  // TODO: Remove this method, ObserverContext should not depend on RpcServer
  public static <E extends CoprocessorEnvironment> ObserverContext<E> createAndPrepare(E env) {
    ObserverContextImpl<E> ctx = new ObserverContextImpl<>(RpcServer.getRequestUser().orElse(null));
    ctx.prepare(env);
    return ctx;
  }
Instantiates a new ObserverContext instance if the passed reference is <code>null</code> and
sets the environment in the new or existing instance. This allows deferring the instantiation
of a ObserverContext until it is actually needed.
@param <E> The environment type for the context
@param env The coprocessor environment to set
@return An instance of <code>ObserverContext</code> with the environment set
hbase-server/src/main/java/org/apache/hadoop/hbase/coprocessor/ObserverContextImpl.java