### Question:
TypeConverter { public Object typeValue(String value, DataType type, Unit unit) { Object typedValue = null; if(value!=null) { try { switch (type) { case string: typedValue = value; break; case date: typedValue = DateJavaTime.parse(value); break; case numeric: if (unit != null) { typedValue = UnitParser.transformUnit(value, unit); } else { value = normaliseNumeric(value); NumberFormat format = NumberFormat.getInstance(Locale.US); Number number = format.parse(value); typedValue = number.doubleValue(); } break; case bool: typedValue = Boolean.parseBoolean(value); break; case coordinate: typedValue = value; break; case link: typedValue = value; default: break; } } catch(ParseException e) { if(isVerbose()) { e.printStackTrace(); } } } return typedValue; }  boolean isVerbose(); void setVerbose(boolean verbose); Object typeValue(String value, DataType type, Unit unit); static String normaliseNumeric(String value);  }### Answer:
@Test public void testTypeValue() { TypeConverter tc = new TypeConverter(); assertEquals(1.0,tc.typeValue("1", DataType.numeric, null)); assertEquals("1936-01-01T00:00", tc.typeValue("1936-01-01", DataType.date, null).toString()); assertEquals("1936-11-30T00:00", tc.typeValue("+1936-11-30T00:00:00Z", DataType.date, null).toString()); assertEquals("1939-05-05T00:00", tc.typeValue("1939-5-5", DataType.date, null).toString()); assertEquals("1939-01-01T00:00", tc.typeValue("1939", DataType.date, null).toString()); String value = "1.5 million"; assertEquals(1500000.0,tc.typeValue(value, DataType.numeric, UnitParser.checkUnit(value))); }