EmptyContext implements Context { @Override public Context withScope(final String scope) { assertNotNull(scope, "Scope must not null"); logger.trace("New context with parent: {}, scope: {}", this, scope); return new ContextConc(this, scope); } EmptyContext(); static Context getInstance(); @Override Context withValue(final Key<T> key, final T value); @Override T get(final Key<T> key); @Override T getOrDefault(final Key<T> key, final T defaultValue); @Override Context withScope(final String scope); @Override String getScope();  }
@Test public void testWithScope() { final Context instance = EmptyContext.getInstance(); final String expected = randomUUID().toString(); final Context context = instance.withScope(expected); final String actual = context.getScope(); assertEquals(expected, actual); }