### Question:
NumberPredicate implements Predicate<String> { @Override public boolean test(String token) { boolean isValid; if (StringUtils.isBlank(token)) { isValid = false; } else { try { Double.valueOf(token); isValid = token.indexOf('d') == -1 && token.indexOf('f') == -1; } catch (NumberFormatException e) { isValid = false; } } return isValid; }  @Override boolean test(String token);  }### Answer:
@Test public void test() { NumberPredicate predicate = new NumberPredicate(); Assert.assertFalse(predicate.test(null)); Assert.assertFalse(predicate.test("")); Assert.assertFalse(predicate.test(" ")); Assert.assertFalse(predicate.test("a")); Assert.assertFalse(predicate.test("5d")); Assert.assertFalse(predicate.test("5f")); Assert.assertTrue(predicate.test("0")); Assert.assertTrue(predicate.test("01")); Assert.assertTrue(predicate.test("01.")); Assert.assertTrue(predicate.test("01.0")); Assert.assertTrue(predicate.test("-4e3")); }