### Question:
IsHostType implements IsType { @Override public boolean check(Object value) { if (value == null || !(value instanceof String)) { return false; } String host = (String) value; if (IP4_PATTERN.matcher(host).matches()) { return true; } if (host.startsWith("*.")) { host = host.substring(2); } if (strict) { return InternetDomainName.isValid(host); } else { return HOSTNAME_PATTERN.matcher(host).matches(); } }  @Override boolean check(Object value); @Override String toString();  }### Answer:
@Test public void test() { IsHostType isHostType = new IsHostType(); Assert.assertTrue(isHostType.check("www.baidu.com")); Assert.assertTrue(isHostType.check("*.baidu.com")); Assert.assertTrue(isHostType.check("localhost")); Assert.assertTrue(isHostType.check("a.b.c.d.e.f")); }