### Question:
StringUtils { public static boolean isValidDNSSuffix(String suffix) throws IllegalArgumentException { if (suffix.length() > 191) { return false; } for (String label : Splitter.on('.').split(suffix)) { if (!labelPattern.matcher(label).matches()) { return false; } } return true; }  static String stripLeadingDigits(String str); static boolean isValidDNSSuffix(String suffix); static String[] getStrings(String str); static Collection<String> getStringCollection(String str); static Collection<String> getTrimmedStringCollection(String str); static String[] getTrimmedStrings(String str); static String arrayToString(String[] strs); static final String[] EMPTY_STRING_ARRAY; }### Answer:
@Test public void testDNSSuffixLengthValidation() { String validLabel = "abcdefghijklmnopqrstuvwxyz0123456789-ABCDEFGHIJKLMNOPQRSTUVWXYZ"; Assert.assertTrue(StringUtils.isValidDNSSuffix(validLabel + "." + validLabel + "." + validLabel)); Assert.assertFalse(StringUtils.isValidDNSSuffix(validLabel + "." + validLabel + "." + validLabel + "." + "asdf")); Assert.assertFalse(StringUtils.isValidDNSSuffix(validLabel + "." + validLabel + "0")); Assert.assertFalse(StringUtils.isValidDNSSuffix("dev.123fasd-.net")); Assert.assertFalse(StringUtils.isValidDNSSuffix("dev.compa_y.net")); Assert.assertFalse(StringUtils.isValidDNSSuffix("dev.compa*y.net")); Assert.assertFalse(StringUtils.isValidDNSSuffix("dev.compa?y.net")); Assert.assertFalse(StringUtils.isValidDNSSuffix("dev.compa&y.net")); Assert.assertFalse(StringUtils.isValidDNSSuffix("dev.compa^y.net")); Assert.assertFalse(StringUtils.isValidDNSSuffix("dev.compa%y.net")); Assert.assertFalse(StringUtils.isValidDNSSuffix("dev.compa#y.net")); Assert.assertFalse(StringUtils.isValidDNSSuffix("dev.compa@y.net")); Assert.assertFalse(StringUtils.isValidDNSSuffix("dev.compa!y.net")); Assert.assertFalse(StringUtils.isValidDNSSuffix("dev.compa(y.net")); Assert.assertFalse(StringUtils.isValidDNSSuffix("dev.compa)y.net")); Assert.assertFalse(StringUtils.isValidDNSSuffix("dev.compa/y.net")); }