### Question:
StripNonNumeric extends SimpleRegexReplacer { public static StripNonNumeric instance() { return instance; } private  StripNonNumeric(); static StripNonNumeric instance(); @Override String convertValue(String value);  }### Answer:
@Test public void testAcceptValidType() { StripNonNumeric stripNonNumeric = StripNonNumeric.instance(); assertTrue(stripNonNumeric.accepts("$abc24.e32")); }
@Test public void testAcceptInvalidType() { StripNonNumeric stripNonNumeric = StripNonNumeric.instance(); Double doubleValue = 1000.05d; assertFalse(stripNonNumeric.accepts(doubleValue)); }
@Test public void testConvertRawValueValidType() { Object expectedValue = "24.32"; Object rawValue = "$abc24.e32"; StripNonNumeric stripNonNumeric = StripNonNumeric.instance(); assertEquals(expectedValue, stripNonNumeric.convertRawValue(rawValue)); }
@Test public void testConvertRawValueInvalidType() { Object expectedValue = Double.valueOf("1000e05"); Object rawValue = Double.valueOf("1000e05"); StripNonNumeric stripNonNumeric = StripNonNumeric.instance(); assertEquals(expectedValue, stripNonNumeric.convertRawValue(rawValue)); }