### Question:
JavaPattern { public static boolean isAllNum(String str) { return str.matches("^[-+]?(([0-9]+)([.]([0-9]+))?|([.]([0-9]+))?)$"); }  static boolean isAllNum(String str);  }### Answer:
@Test public void testAllNums() { assertTrue(JavaPattern.isAllNum("1234569870")); }
@Test public void testNotAllNums() { assertFalse(JavaPattern.isAllNum("123@456%d987s0")); }
@Test public void testAllNotNums() { assertFalse(JavaPattern.isAllNum("shdjjdfn^@dd")); }