### Question:
HeroRestController implements HeroApi { @Override public ResponseEntity<List<String>> getHeroRepositoryNames() { return ResponseEntity.ok(heroService.getHeroRepositoryNames().stream().collect(Collectors.toList())); } HeroRestController(HeroService heroService, HeroMapper mapper); @Override ResponseEntity<Void> addHeroToRepository(String repository, Hero body); @Override ResponseEntity<List<Hero>> collectAllHeros(); @Override ResponseEntity<List<String>> getHeroRepositoryNames();  }### Answer:
@Test public void getHeroRepositoryNames() throws Exception { when(heroService.getHeroRepositoryNames()).thenReturn(new HashSet<>(Arrays.asList("repo1", "repo2"))); mockMvc.perform(get("/api/hero/repositories")) .andExpect(status().isOk()) .andExpect(jsonPath("$", Matchers.hasSize(2))); }