### Question:
ReadOnlySession implements Session { @Override public void set(String key, String value) { throw new Error("session is readonly for websocket"); } ReadOnlySession(Session session); @Override Optional<String> get(String key); @Override void set(String key, String value); @Override void invalidate();  }### Answer:
@Test void set() { assertThatThrownBy(() -> session.set("key", "value")) .isInstanceOf(Error.class) .hasMessageContaining("readonly"); }