### Question:
SearchStore { public UUID add(SearchResult searchResult) { UUID id = UUID.randomUUID(); cache.put(id, searchResult); searchResult.setId(id); return id; } SearchStore(Timeout searchResultAvailabilityTime); Optional<SearchResult> getSearchResult(UUID id); UUID add(SearchResult searchResult);  }### Answer:
@Test public void addReturnsAnId() { UUID id = instance.add(searchResult); assertThat(id, is(notNullValue())); }
@Test public void addCreatesADifferentIdEachCall() { UUID id1 = instance.add(searchResult); UUID id2 = instance.add(searchResult); assertThat(id1, is(not(id2))); }
@Test public void addSetsTheIdToTheSearchResult() { UUID id = instance.add(searchResult); assertThat(searchResult, hasProperty("id", equalTo(id))); }