### Question:
ValueNormalizer { public Object normalize(String value, DataType type, UnitCategory unitcategory) { Object normalizedValue = null; if(value!=null) { try { switch (type) { case string: normalizedValue = value; break; case date: normalizedValue = DateJavaTime.parse(value); break; case numeric: Quantity quantity = UnitCategoryParser.checkQuantity(value); Unit unit = UnitCategoryParser.checkUnit(value, unitcategory); normalizedValue = UnitCategoryParser.transform(value, unit, quantity); break; case bool: normalizedValue = Boolean.parseBoolean(value); break; case coordinate: normalizedValue = value; break; case link: normalizedValue = value; default: break; } } catch(ParseException e) { logger.trace("ParseException for " + type.name() + " value: " + value); } } return normalizedValue; }  Object normalize(String value, DataType type, UnitCategory unitcategory);  }### Answer:
@Test public void testTypeValue() { ValueNormalizer valueNormalizer = new ValueNormalizer(); assertEquals(1.0,valueNormalizer.normalize("1", DataType.numeric, null)); String value = "1.5 million"; assertEquals(1500000.0,valueNormalizer.normalize(value, DataType.numeric, UnitCategoryParser.checkUnitCategory(value))); assertEquals(1500000.0,valueNormalizer.normalize(value, DataType.numeric, null)); String value2 = "1.5 km"; assertEquals(1500.0,valueNormalizer.normalize(value2, DataType.numeric, UnitCategoryParser.checkUnitCategory(value2))); assertEquals(1500.0,valueNormalizer.normalize(value2, DataType.numeric, UnitCategoryParser.getUnitCategory("Distance"))); assertNotSame(1500.0,valueNormalizer.normalize(value2, DataType.numeric, null)); assertEquals(1.5,valueNormalizer.normalize(value2, DataType.numeric, null)); String value3 = "1.5 thousand km"; assertEquals(1500000.0,valueNormalizer.normalize(value3, DataType.numeric, UnitCategoryParser.checkUnitCategory(value3))); assertEquals(1500000.0,valueNormalizer.normalize(value3, DataType.numeric, UnitCategoryParser.getUnitCategory("Distance"))); String value4 = "asd thousand km"; assertEquals(null,valueNormalizer.normalize(value4, DataType.numeric, UnitCategoryParser.checkUnitCategory(value4))); String value5 = "85 mph"; assertEquals(136.7939,valueNormalizer.normalize(value5, DataType.numeric, UnitCategoryParser.checkUnitCategory(value5))); assertEquals(136.7939,valueNormalizer.normalize(value5, DataType.numeric, UnitCategoryParser.getUnitCategory("Speed"))); String value6 = "357386 km2"; assertEquals(357386000000.0,valueNormalizer.normalize(value6, DataType.numeric, UnitCategoryParser.checkUnitCategory(value6))); assertEquals(357386000000.0,valueNormalizer.normalize(value6, DataType.numeric, UnitCategoryParser.getUnitCategory("Area"))); String value7 = "$ 50 thousand"; assertEquals(valueNormalizer.normalize(value7, DataType.numeric, null),50000.0); }