@VisibleForTesting
    static ExternalResourceInfoProvider createStaticExternalResourceInfoProvider(
            Map<String, Long> externalResourceAmountMap,
            Map<String, ExternalResourceDriver> externalResourceDrivers) {
        final Map<String, Set<? extends ExternalResourceInfo>> externalResources = new HashMap<>();
        for (Map.Entry<String, ExternalResourceDriver> externalResourceDriverEntry :
                externalResourceDrivers.entrySet()) {
            final String resourceName = externalResourceDriverEntry.getKey();
            final ExternalResourceDriver externalResourceDriver =
                    externalResourceDriverEntry.getValue();
            if (externalResourceAmountMap.containsKey(resourceName)) {
                try {
                    final Set<? extends ExternalResourceInfo> externalResourceInfos;
                    externalResourceInfos =
                            externalResourceDriver.retrieveResourceInfo(
                                    externalResourceAmountMap.get(resourceName));
                    externalResources.put(resourceName, externalResourceInfos);
                } catch (Exception e) {
                    LOG.warn(
                            "Failed to retrieve information of external resource {}.",
                            resourceName,
                            e);
                }
            } else {
                LOG.warn("Could not found legal amount configuration for {}.", resourceName);
            }
        }
        return new StaticExternalResourceInfoProvider(externalResources);
    }
@Test
    public void testGetExternalResourceInfoProviderWithoutAmount() {
        final Map<String, Long> externalResourceAmountMap = new HashMap<>();
        final Map<String, ExternalResourceDriver> externalResourceDrivers = new HashMap<>();
        externalResourceDrivers.put(RESOURCE_NAME_1, new TestingExternalResourceDriver());

        final StaticExternalResourceInfoProvider externalResourceInfoProvider =
                (StaticExternalResourceInfoProvider)
                        ExternalResourceUtils.createStaticExternalResourceInfoProvider(
                                externalResourceAmountMap, externalResourceDrivers);

        assertThat(externalResourceInfoProvider.getExternalResources().entrySet(), is(empty()));
    }