### Question:
Numeric extends Number { public static Numeric create(Number number) { if (number == null) { throw new NullPointerException(); } if (number instanceof Double && ((Double)number).isInfinite() || number instanceof Float && ((Float)number).isInfinite()) { throw new NumberFormatException("Infinite numbers are not valid numerics"); } return new Numeric(number); } 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 testCreate() { assertEquals(shortValue, Numeric.create(shortValue).shortValue()); assertEquals(intValue, Numeric.create(intValue).intValue()); assertEquals(longValue, Numeric.create(longValue).longValue()); assertEquals(floatValue, Numeric.create(floatValue).floatValue(), 0.01f); assertEquals(doubleValue, Numeric.create(doubleValue).doubleValue(), 0.01f); assertEquals(bigIntegerValue, Numeric.create(bigIntegerValue).bigIntegerValue()); assertEquals(bigDecimalValue, Numeric.create(bigDecimalValue).bigDecimalValue()); }