class DeviceGatewayProviders {
    private static final Map<String, DeviceGatewayProvider> providers = new ConcurrentHashMap<>();

    public static void register(DeviceGatewayProvider provider) {
        providers.put(provider.getId(), provider);
    }

    public static Optional<DeviceGatewayProvider> getProvider(String provider) {
        return Optional.ofNullable(providers.get(provider));
    }

    public static DeviceGatewayProvider getProviderNow(String provider) {<FILL_FUNCTION_BODY>}

    public static List<DeviceGatewayProvider> getAll() {
        return new ArrayList<>(providers.values());
    }

}

        DeviceGatewayProvider gatewayProvider = providers.get(provider);
        if (null == gatewayProvider) {
            throw new I18nSupportException("error.unsupported_device_gateway_provider", provider);
        }
        return gatewayProvider;
    
<no_super_class>