public static final Context ensureCtx(InitialContext ctx, String name) throws NamingException {
        try {
            return ctx.createSubcontext(name);
        } catch (NameAlreadyBoundException e) {
            // this is ok
            return (Context) ctx.lookup(name);
        }
    }
Ensure that the given name is bound to a context.
@param ctx
@param name
@throws NamingException
test/common/src/main/java/io/apiman/test/common/util/TestUtil.java