### Question:
RecommenderContext { @SuppressWarnings("unchecked") @Nullable synchronized public <T> Optional<T> get(Key<T> aKey) { return Optional.ofNullable((T) store.get(aKey.name)); } RecommenderContext(); @SuppressWarnings("unchecked") @Nullable synchronized Optional<T> get(Key<T> aKey); synchronized void put(Key<T> aKey, T aValue); synchronized void info(String aFormat, Object... aValues); synchronized void warn(String aFormat, Object... aValues); synchronized void error(String aFormat, Object... aValues); List<LogMessage> getMessages(); synchronized void close(); synchronized boolean isClosed(); Optional<User> getUser(); void setUser(User aUser); static final RecommenderContext EMPTY_CONTEXT; }### Answer:
@Test public void thatGettingNonexistantKeyThrows() { Optional<String> result = sut.get(KEY); assertThat(result.isPresent()).isFalse(); }