### Question:
BreakTimeServiceImpl implements BreakTimeService { @Override public BreakTime save(BreakTime breakTime) { log.info(LogMessage.IN_SAVE, breakTime); if (breakTime.getEndTime().getHour() < breakTime.getStartTime().getHour()) { throw new BadRequestException(ErrorMessage.END_TIME_LATE_THAN_START_TIME); } return repo.save(breakTime); }  @Override BreakTime save(BreakTime breakTime); @Override BreakTime findById(Long id); @Override Long deleteById(Long id); @Override List<BreakTime> findAll();  }### Answer:
@Test public void saveValidBreakTime() { when(breakTimeRepo.save(validBreakTime)).thenReturn(validBreakTime); assertEquals(validBreakTime, breakTimeService.save(validBreakTime)); }
@Test(expected = BadRequestException.class) public void saveNotValidBreakTime() { breakTimeService.save(notValidBreakTime); }