### Question:
AdapterServiceLoader { public <T extends AdapterServiceProvider> Optional<T> getServiceProvider(Class<T> klass, String adapterId) { MDC.put("adapterId", adapterId); Optional<T> serviceProvider; synchronized (serviceLoaders) { serviceProvider = StreamSupport.stream(getServiceLoader(klass).spliterator(), false) .filter(provider -> provider.getAdapterId().equalsIgnoreCase(adapterId)) .findFirst(); } return serviceProvider; } AdapterServiceLoader(AspspReadOnlyRepository aspspRepository,
                                Pkcs12KeyStore keyStore,
                                HttpClientFactory httpClientFactory,
                                LinksRewriter accountInformationLinksRewriter,
                                LinksRewriter paymentInitiationLinksRewriter,
                                boolean chooseFirstFromMultipleAspsps); AccountInformationService getAccountInformationService(RequestHeaders requestHeaders); Optional<T> getServiceProvider(Class<T> klass, String adapterId); PaymentInitiationService getPaymentInitiationService(RequestHeaders requestHeaders); Oauth2Service getOauth2Service(RequestHeaders requestHeaders); DownloadService getDownloadService(RequestHeaders requestHeaders);  }### Answer:
@Test void getServiceProvider() { Optional<AccountInformationServiceProvider> accountInformationServiceProvider = adapterServiceLoader.getServiceProvider(AccountInformationServiceProvider.class, ADAPTER_ID); assertThat(accountInformationServiceProvider).get().hasFieldOrPropertyWithValue("adapterId", ADAPTER_ID); }
@Test void getServiceProviderIsCaseInsensitive() { Optional<AccountInformationServiceProvider> accountInformationServiceProvider = adapterServiceLoader.getServiceProvider(AccountInformationServiceProvider.class, ADAPTER_ID.toUpperCase()); assertThat(accountInformationServiceProvider).get().hasFieldOrPropertyWithValue("adapterId", ADAPTER_ID); }