@Test public void testWithScope() { final Context context = new ContextConc(root, randomUUID().toString()); final String expected = randomUUID().toString(); final Context newContext = context.withScope(expected); final String actual = newContext.getScope(); assertEquals(expected, actual); }
@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); }
ContextConc 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); } }
ContextConc 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); } <T> ContextConc(final Context parent, final String scope);  <T> ContextConc(final Context parent, final Key<T> key, final T value); }
ContextConc 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); } <T> ContextConc(final Context parent, final String scope);  <T> ContextConc(final Context parent, final Key<T> key, final T value); @Override Context withValue(final Key<T> key, final T value); @SuppressWarnings("unchecked") @Override T get(final Key<T> key); @SuppressWarnings("unchecked") @Override T getOrDefault(final Key<T> key, final T defaultValue); @Override Context withScope(final String scope); @Override String getScope(); }
ContextConc 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); } <T> ContextConc(final Context parent, final String scope);  <T> ContextConc(final Context parent, final Key<T> key, final T value); @Override Context withValue(final Key<T> key, final T value); @SuppressWarnings("unchecked") @Override T get(final Key<T> key); @SuppressWarnings("unchecked") @Override T getOrDefault(final Key<T> key, final T defaultValue); @Override Context withScope(final String scope); @Override String getScope();  }