ConfigUtil { public static Map<String, @Nullable Object> normalizeTypes(Map<String, @Nullable Object> configuration) { Map<String, @Nullable Object> convertedConfiguration = new HashMap<>(configuration.size()); for (Entry<String, @Nullable Object> parameter : configuration.entrySet()) { String name = parameter.getKey(); Object value = parameter.getValue(); if (!isOSGiConfigParameter(name)) { convertedConfiguration.put(name, value == null ? null : normalizeType(value, null)); } } return convertedConfiguration; }  static @Nullable Object getDefaultValueAsCorrectType(ConfigDescriptionParameter parameter); static void applyDefaultConfiguration(Configuration configuration,
            @Nullable ConfigDescription configDescription); static Map<String, @Nullable Object> normalizeTypes(Map<String, @Nullable Object> configuration); static Object normalizeType(Object value, @Nullable ConfigDescriptionParameter configDescriptionParameter); static @Nullable Map<String, Object> normalizeTypes(@Nullable Map<String, Object> configuration,
            List<ConfigDescription> configDescriptions); static Object normalizeType(Object value);  }
@Test public void firstDesciptionWinsForNormalization() throws URISyntaxException { ConfigDescription configDescriptionInteger = ConfigDescriptionBuilder.create(new URI("thing:fooThing")) .withParameter(ConfigDescriptionParameterBuilder.create("foo", INTEGER).build()).build(); ConfigDescription configDescriptionString = ConfigDescriptionBuilder.create(new URI("thingType:fooThing")) .withParameter(ConfigDescriptionParameterBuilder.create("foo", TEXT).build()).build(); assertThat(ConfigUtil.normalizeTypes(Map.of("foo", "1"), List.of(configDescriptionInteger)).get("foo"), is(instanceOf(BigDecimal.class))); assertThat(ConfigUtil.normalizeTypes(Map.of("foo", "1"), List.of(configDescriptionString)).get("foo"), is(instanceOf(String.class))); assertThat(ConfigUtil .normalizeTypes(Map.of("foo", "1"), List.of(configDescriptionInteger, configDescriptionString)) .get("foo"), is(instanceOf(BigDecimal.class))); assertThat(ConfigUtil .normalizeTypes(Map.of("foo", "1"), List.of(configDescriptionString, configDescriptionInteger)) .get("foo"), is(instanceOf(String.class))); }