ServerUtils { public boolean isValid(String string) { boolean valid = false; if ((null != string) && !string.isEmpty()) { String str = string.replaceAll("[A-Za-z0-9]", ""); if (str.length() == 0) { valid = true; } } return valid; }  String toLowerAlphaNumeric(String str); String clean(String string); boolean isValid(String string);  }
@Test(dataProvider = "testIsValidData") public void testIsValid(String string, boolean expected) { Assert.assertEquals(utils.isValid(string), expected); }