@Test public void testPut() { final Context expected = EmptyContext.getInstance() .withValue(Key.of(randomUUID().toString(), String.class), randomUUID().toString()) .withValue(Key.of(randomUUID().toString(), String.class), randomUUID().toString()) .withValue(Key.of(randomUUID().toString(), String.class), randomUUID().toString()); final ContextStorage<Context> contextStorage = new UnmodifiableContextStorage(expected); final Context actual = contextStorage.get(); assertEquals(expected, actual); }
@Override public Context put(final Context context) { throw new UnsupportedOperationException("Cannot put context"); }
UnmodifiableContextStorage implements ContextStorage<Context> { @Override public Context put(final Context context) { throw new UnsupportedOperationException("Cannot put context"); } }
UnmodifiableContextStorage implements ContextStorage<Context> { @Override public Context put(final Context context) { throw new UnsupportedOperationException("Cannot put context"); } UnmodifiableContextStorage(final Context context); }
UnmodifiableContextStorage implements ContextStorage<Context> { @Override public Context put(final Context context) { throw new UnsupportedOperationException("Cannot put context"); } UnmodifiableContextStorage(final Context context); @Override Context get(); @Override Context put(final Context context); }
UnmodifiableContextStorage implements ContextStorage<Context> { @Override public Context put(final Context context) { throw new UnsupportedOperationException("Cannot put context"); } UnmodifiableContextStorage(final Context context); @Override Context get(); @Override Context put(final Context context);  }