### Question:
PhotoServiceImpl implements PhotoService { @Override public Optional<Photo> findByName(String name) { return photoRepo.findByName(name); }  @Override Optional<Photo> findByName(String name);  }### Answer:
@Test public void findByNameTest() { when(photoRepo.findByName("test")).thenReturn(Optional.of(new Photo())); assertEquals(Optional.of(new Photo()), photoService.findByName("test")); }
@Test public void findByNameEmptyTest() { when(photoRepo.findByName("")).thenReturn(Optional.empty()); assertEquals(Optional.empty(), photoService.findByName("")); }