### Question:
Numeric extends Number { public static Numeric parse(String s) { switch (s) { case "NaN": return NaN; default: return new Numeric(new BigDecimal(s)); } } private  Numeric(Number value); static Numeric create(Number number); static Numeric parse(String s); @Override short shortValue(); @Override int intValue(); @Override long longValue(); @Override float floatValue(); @Override double doubleValue(); boolean isNaN(); BigDecimal bigDecimalValue(); BigInteger bigIntegerValue(); @Override boolean equals(Object obj); @Override int hashCode(); @Override String toString(); static final Numeric NaN; }### Answer:
@Test public void testParse() { assertEquals(Numeric.NaN, Numeric.parse("NaN")); assertEquals(Numeric.create(bigDecimalValue), Numeric.parse(bigDecimalValue.toString())); assertEquals(Numeric.create(bigIntegerValue), Numeric.parse(bigIntegerValue.toString())); assertEquals(Numeric.create(longValue), Numeric.parse("" + longValue)); assertEquals(Numeric.create(shortValue), Numeric.parse("" + shortValue)); assertEquals(Numeric.create(intValue), Numeric.parse("" + intValue)); assertEquals(Numeric.create(floatValue), Numeric.parse("" + floatValue)); assertEquals(Numeric.create(doubleValue), Numeric.parse("" + doubleValue)); }