static PodSecurityProvider findProviderOrThrow(String providerClass)   {
        ServiceLoader<PodSecurityProvider> loader = ServiceLoader.load(PodSecurityProvider.class);

        for (PodSecurityProvider provider : loader)  {
            if (providerClass.equals(provider.getClass().getCanonicalName()))   {
                LOGGER.info("Found PodSecurityProvider {}", providerClass);
                return provider;
            }
        }

        // The provider was not found
        LOGGER.warn("PodSecurityProvider {} was not found. Available providers are {}", providerClass, loader.stream().map(p -> p.getClass().getCanonicalName()).collect(Collectors.toSet()));
        throw new InvalidConfigurationException("PodSecurityProvider " + providerClass + " was not found.");
    }
@Test
    public void testMissingClass() {
        Exception ex = assertThrows(InvalidConfigurationException.class, () -> PodSecurityProviderFactory.findProviderOrThrow("my.package.MyCustomPodSecurityProvider"));
        assertThat(ex.getMessage(), is("PodSecurityProvider my.package.MyCustomPodSecurityProvider was not found."));
    }