DecimalFormatMerger implements SinglePropertyValueMerger<String, Number> { @Override public Number restoreObject(String object, String[] params) { try { if (object == null) { return null; } DecimalFormat format = getDecimalFormat(params); return format.parse(object); } catch (ParseException ex) { throw new IllegalArgumentException(ex); } }  @Override String mergeObjects(Number value, String[] extraParam); @Override boolean isRestoreSupported(String[] params); @Override Number restoreObject(String object, String[] params);  }
@Test(expected=IllegalArgumentException.class) public void testIllegalFormatStringRestore() { final String testFormat = "#,###.00"; String[] params = {testFormat}; subject.restoreObject("# abcd # efghi", params); fail("Should not have reached this point"); }