### Question:
ConfigurationProperties { static Object convertConfigValue(Class<?> defaultValueType, Object value) { if (defaultValueType.equals(String.class)) { return value.toString(); } else if (defaultValueType.equals(Boolean.class)) { return Boolean.valueOf(value.toString()); } else if (defaultValueType.equals(Long.class)) { return Long.valueOf(value.toString()); } else if (defaultValueType.equals(Integer.class)) { return Integer.valueOf(value.toString()); } throw new IllegalStateException( "Unsupported default value type: " + defaultValueType); } private  ConfigurationProperties();   }### Answer:
@Test public void testConvertConfigValue() { assertEquals(10, ConfigurationProperties .convertConfigValue(Integer.class, "10")); assertEquals(10L, ConfigurationProperties.convertConfigValue(Long.class, "10")); assertEquals(Boolean.FALSE, ConfigurationProperties .convertConfigValue(Boolean.class, "10")); }
@Test(expected = IllegalStateException.class) public void testConvertConfigValueFails() { ConfigurationProperties.convertConfigValue(BigDecimal.class, "10"); }