### Question:
ProbabilityNumberAdapter extends NumberAdapter { @Override public Number unmarshal(String value){ Number result = super.unmarshal(value); if(!isValid(result)){ throw new IllegalArgumentException(value); } return result; }  @Override Number unmarshal(String value); static boolean isValid(Number value);  }### Answer:
@Test public void unmarshal(){ NumberAdapter adapter = new ProbabilityNumberAdapter(); try { adapter.unmarshal("-0.1"); fail(); } catch(IllegalArgumentException iae){ } assertEquals(-0d, adapter.unmarshal("-0.0")); assertEquals(0d, adapter.unmarshal("0.0")); assertEquals(1d, adapter.unmarshal("1.0")); try { adapter.unmarshal("1.1"); fail(); } catch(IllegalArgumentException iae){ } }