ConfigPropertyParser { Map<String, ConfigurationProperty> getConfigPropertiesByName(Class configClass) throws ConfigBuilderException { List<ConfigurationProperty> properties = getConfigProperties(configClass); return properties.stream().collect(toMap(ConfigurationProperty::getName, identity())); }  List<ConfigurationProperty> getConfigProperties(Class configClass);  }
@Test public void defaultValuesCanBeConvertedToSimpleTypes() throws ConfigBuilderException { Map<String, ConfigurationProperty> m = configPropertyParser.getConfigPropertiesByName(ConfigBeanWithPrimitiveTypedProperties.class); assertEquals(7, m.size()); assertEquals(1, m.get("integerProperty").getDefaultValue().get()); assertEquals(1000000L, m.get("longProperty").getDefaultValue().get()); assertEquals(1.23d, m.get("doubleProperty").getDefaultValue().get()); assertEquals(2.34f, m.get("floatProperty").getDefaultValue().get()); assertEquals(true, m.get("booleanProperty").getDefaultValue().get()); assertEquals('C', m.get("charProperty").getDefaultValue().get()); assertEquals((short)9, m.get("shortProperty").getDefaultValue().get()); }