### Question:
DataTypeUtilities { public static Object fromDouble(double value, Class<?> theClass) { Object o; if (Number.class.isAssignableFrom(theClass)) { o = Double.valueOf(value); } else if (Date.class.isAssignableFrom(theClass)) { o = new Date((long)value); } else if (TimeSpan.class.isAssignableFrom(theClass)) { o = TimeSpan.get((long)value); } else if (String.class.isAssignableFrom(theClass)) { o = String.valueOf(value); } else { throw new IllegalArgumentException(value + " can't be converted to an object"); } return o; } private  DataTypeUtilities(); static boolean isNumeric(Object o); static boolean isNumeric(Class<?> c); static double toDouble(Object o); static Object fromDouble(double value, Class<?> theClass); static int compareTo(Object o1, Object o2); static String getLabel(Object o);  }### Answer:
@Test public void testFromDouble() { assertEquals(Double.valueOf(1.2), DataTypeUtilities.fromDouble(1.2, Double.class)); assertEquals(new Date(100), DataTypeUtilities.fromDouble(100, Date.class)); assertEquals("0.0", DataTypeUtilities.fromDouble(0, String.class)); assertEquals("1.2", DataTypeUtilities.fromDouble(1.2, String.class)); }