### Question:
RealNumberAdapter extends XmlAdapter<String, Number> { @Override public String marshal(Number value){ if(value == null){ return null; } return NumberUtil.printNumber(value); }  @Override Number unmarshal(String value); @Override String marshal(Number value);  }### Answer:
@Test public void marshal(){ RealNumberAdapter adapter = new RealNumberAdapter(); assertEquals("NaN", adapter.marshal(Float.NaN)); assertEquals("-INF", adapter.marshal(Float.NEGATIVE_INFINITY)); assertEquals("INF", adapter.marshal(Float.POSITIVE_INFINITY)); assertEquals("NaN", adapter.marshal(Double.NaN)); assertEquals("-INF", adapter.marshal(Double.NEGATIVE_INFINITY)); assertEquals("INF", adapter.marshal(Double.POSITIVE_INFINITY)); assertEquals("1", adapter.marshal(1)); assertEquals("1.0", adapter.marshal(1f)); assertEquals("1.0", adapter.marshal(1d)); }