DawgUtil { public static String onlyAlphaNumerics(String str) { StringBuilder rv = new StringBuilder(); for (char c : str.toCharArray()) { if (Character.isLetterOrDigit(c)) { rv.append(c); } } return rv.toString(); }  static String onlyAlphaNumerics(String str); static String toLowerAlphaNumeric(String str);  }
@Test public void testOnlyAlphaNumerics() { String str = "sSsS1"; Assert.assertEquals(DawgUtil.onlyAlphaNumerics(testString), str); }