public static void ensureSameCtx(RequestContext ctx, ContextHolder contextHolder, Class<?> type) {
        if (ctx != contextHolder.context()) {
            throw new IllegalArgumentException(
                    "cannot create a " + type.getSimpleName() + " using another " + contextHolder);
        }
    }
Invokes {@link DefaultServiceRequestContext#hook()} or {@link DefaultClientRequestContext#hook()} and
returns {@link SafeCloseable} which pops the current {@link RequestContext} in the storage and pushes
back the specified {@code toRestore}.
core/src/main/java/com/linecorp/armeria/internal/common/RequestContextUtil.java