public String get(MetaDataKey key) {
        return metadata.get(key.getName());
    }
@Test
    public void testAutoBuild() throws Exception {
        try (MockedStatic<AmazonInfoUtils> mockUtils = mockStatic(AmazonInfoUtils.class)) {
            mockUtils.when(
                    () -> AmazonInfoUtils.readEc2MetadataUrl(any(AmazonInfo.MetaDataKey.class), any(URL.class), anyInt(), anyInt())
            ).thenReturn(null);

            mockUtils.when(
                    () -> AmazonInfoUtils.readEc2MetadataUrl(any(AmazonInfo.MetaDataKey.class), any(URL.class), anyInt(), anyInt())
            ).thenReturn(null);

            URL macsUrl = AmazonInfo.MetaDataKey.macs.getURL(null, null);
            mockUtils.when(
                    () -> AmazonInfoUtils.readEc2MetadataUrl(eq(AmazonInfo.MetaDataKey.macs), eq(macsUrl), anyInt(), anyInt())
            ).thenReturn("0d:c2:9a:3c:18:2b\n4c:31:99:7e:26:d6");

            URL firstMacPublicIPv4sUrl = AmazonInfo.MetaDataKey.publicIpv4s.getURL(null, "0d:c2:9a:3c:18:2b");
            mockUtils.when(
                    () -> AmazonInfoUtils.readEc2MetadataUrl(eq(AmazonInfo.MetaDataKey.publicIpv4s), eq(firstMacPublicIPv4sUrl), anyInt(), anyInt())
            ).thenReturn(null);

            URL secondMacPublicIPv4sUrl = AmazonInfo.MetaDataKey.publicIpv4s.getURL(null, "4c:31:99:7e:26:d6");
            mockUtils.when(
                    () -> AmazonInfoUtils.readEc2MetadataUrl(eq(AmazonInfo.MetaDataKey.publicIpv4s), eq(secondMacPublicIPv4sUrl), anyInt(), anyInt())
            ).thenReturn("10.0.0.1");

            AmazonInfoConfig config = mock(AmazonInfoConfig.class);
            when(config.getNamespace()).thenReturn("test_namespace");
            when(config.getConnectTimeout()).thenReturn(10);
            when(config.getNumRetries()).thenReturn(1);
            when(config.getReadTimeout()).thenReturn(10);
            when(config.shouldLogAmazonMetadataErrors()).thenReturn(false);
            when(config.shouldValidateInstanceId()).thenReturn(false);
            when(config.shouldFailFastOnFirstLoad()).thenReturn(false);

            AmazonInfo info = AmazonInfo.Builder.newBuilder().withAmazonInfoConfig(config).autoBuild("test_namespace");

            assertEquals("10.0.0.1", info.get(AmazonInfo.MetaDataKey.publicIpv4s));
        }
    }