### Question:
HeroRestController implements HeroApi { @Override public ResponseEntity<List<Hero>> collectAllHeros() { return ResponseEntity.ok( heroService.collectAllHeros() .stream() .map(mapper::reverseMap) .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 collectAllHeros() throws Exception{ when(heroService.collectAllHeros()).thenReturn(createHeroList()); mockMvc.perform(get("/api/hero/heros")) .andExpect(status().isOk()) .andExpect(jsonPath("$", Matchers.hasSize(2))) .andExpect(jsonPath("$[0].name", Matchers.is("Batman"))); }