ImporterContext { public ImporterService getImporterService() { return Objects.requireNonNull(this.importerService, "Importer service was not initialized"); } ImporterContext(final ImportSettings settings); void setImporterService(final ImporterService importerService); ImporterService getImporterService(); ImportSettings getImportSettings();  }
@Test void testGetImporterServiceNullByDefault() { assertThrows(NullPointerException.class, () -> this.context.getImporterService()); }
@Test void testGetImporterService() { this.context.setImporterService(this.importerServiceMock); assertThat(this.context.getImporterService(), sameInstance(this.importerServiceMock)); }