### Question:
NumberAdapter extends XmlAdapter<String, Number> { @Override public Number unmarshal(String value){ Number result = NumberUtil.parseNumber(value); if(!isValid(result)){ throw new IllegalArgumentException(value); } return result; }  @Override Number unmarshal(String value); @Override String marshal(Number value); static boolean isValid(Number value);  }### Answer:
@Test public void unmarshal(){ NumberAdapter adapter = new NumberAdapter(); try { adapter.unmarshal("NaN"); fail(); } catch(IllegalArgumentException iae){ } try { adapter.unmarshal("INF"); fail(); } catch(IllegalArgumentException iae){ } assertEquals(1, adapter.unmarshal("1")); assertEquals(1d, adapter.unmarshal("1.0")); }