### Question:
CliOptionsProvider { public Options provide() { if (isHelpRequired()) { throw new CliHelpException(helpProvider.getHelp()); } Options options = new Options(); for (CliOptionHandler handler : handlers) { CliOption handledOption = handler.getHandledCliOption(); String propertyValue = environment.getProperty(handledOption.asName()); log.debug("Handling command line argument {} with value of {}", handledOption.asCliOption(), propertyValue); handler.handle(propertyValue, options); } cliOptionsValidator.validate(options); return options; }  Options provide();  }### Answer:
@Test public void testProvideShouldThrowExceptionWhenHelpIsRequired() { given(environment.getProperty("help")).willReturn(""); Throwable exception = catchThrowable(() -> underTest.provide()); assertThat(exception).isInstanceOf(CliHelpException.class); then(helpProvider).should().getHelp(); }