### Question:
Util { public static boolean isNumber(String value) { if (value != null) { int n = value.length(); for (int i = 0; i < n; i++) { char x = value.charAt(i); if (!Character.isDigit(x) && !(i == 0 && (x == '-' || x == '+'))) { return false; } } return n > 0; } return false; } private  Util(); static boolean isNumber(String value);  }### Answer:
@Test public void isNumber_true() { Assert.assertTrue(Util.isNumber("0")); Assert.assertTrue(Util.isNumber("1")); Assert.assertTrue(Util.isNumber("+1")); Assert.assertTrue(Util.isNumber("-1")); Assert.assertTrue(Util.isNumber("100")); Assert.assertTrue(Util.isNumber("+100")); Assert.assertTrue(Util.isNumber("-100")); }
@Test public void isNumber_false() { Assert.assertFalse(Util.isNumber(null)); Assert.assertFalse(Util.isNumber("")); Assert.assertFalse(Util.isNumber("a")); Assert.assertFalse(Util.isNumber("1-")); }