@Test public void get_lowest() { // given when(defaultHierarchy.lowestRankName()).thenReturn("low"); OptionCacheKey cacheKey = new OptionCacheKey(defaultHierarchy, LOWEST_RANK, optionKey2); when(optionCache.get(Optional.of(5), cacheKey)).thenAnswer(answerOf(20)); // when Integer actual = option.getLowestRanked(optionKey2); // then assertThat(actual).isEqualTo(20); }