@Test public void shouldPutThrowException() { final ContextStorage<Context> contextStorage = new UnmodifiableContextStorage( EmptyContext.getInstance()); try { contextStorage.put(EmptyContext.getInstance()); fail("Should throw UnsupportedOperationException"); } catch (UnsupportedOperationException e) { } }
@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);  }