@Test void testClear() { Context topLevel = Context.create(); topLevel.register("topLevel", TEST_STRING); topLevel.register("first", TEST_STRING); Contexts.push(topLevel); Context myContext = Contexts.context().get(); assertThat(myContext.get("topLevel", String.class), is(TEST_STRING_OPTIONAL)); assertThat(myContext.get("first", String.class), is(TEST_STRING_OPTIONAL)); Contexts.clear(); assertThat(Contexts.context(), is(Optional.empty())); }
static void clear() { REGISTRY.get().clear(); }
Contexts { static void clear() { REGISTRY.get().clear(); } }
Contexts { static void clear() { REGISTRY.get().clear(); } private  Contexts(); }
Contexts { static void clear() { REGISTRY.get().clear(); } private  Contexts(); static Optional<Context> context(); static ExecutorService wrap(ExecutorService toWrap); static ScheduledExecutorService wrap(ScheduledExecutorService toWrap); static void runInContext(Context context, Runnable runnable); static T runInContext(Context context, Callable<T> callable); static T runInContextWithThrow(Context context, Callable<T> callable); }
Contexts { static void clear() { REGISTRY.get().clear(); } private  Contexts(); static Optional<Context> context(); static ExecutorService wrap(ExecutorService toWrap); static ScheduledExecutorService wrap(ScheduledExecutorService toWrap); static void runInContext(Context context, Runnable runnable); static T runInContext(Context context, Callable<T> callable); static T runInContextWithThrow(Context context, Callable<T> callable);  }