### Question:
BreakTimeServiceImpl implements BreakTimeService { @Override public BreakTime findById(Long id) { log.info(LogMessage.IN_FIND_BY_ID, id); return repo .findById(id) .orElseThrow( () -> new NotFoundException(ErrorMessage.BREAK_TIME_NOT_FOUND_BY_ID + id)); }  @Override BreakTime save(BreakTime breakTime); @Override BreakTime findById(Long id); @Override Long deleteById(Long id); @Override List<BreakTime> findAll();  }### Answer:
@Test public void findByExistingId() { when(breakTimeRepo.findById(validBreakTime.getId())).thenReturn(Optional.of(validBreakTime)); assertEquals(validBreakTime, breakTimeService.findById(validBreakTime.getId())); }
@Test(expected = NotFoundException.class) public void findByNotExistingId() { when(breakTimeRepo.findById(anyLong())).thenReturn(Optional.empty()); breakTimeService.findById(13L); }