public static boolean containsOnly(String str, String validChars) { if (str == null || validChars == null) {
public static boolean containsOnly(String str, char[] valid) {  if ((valid == null) || (str == null)) {
    public static boolean containsOnly(String str, String validChars) {        if (str == null || validChars == null) {            return false;        }        return containsOnly(str, validChars.toCharArray());    }