### Question:
XsdIDValidator { public static boolean validate(String name) { if (isFirstLetterValid(name)) { for (int i = 0; i < name.length(); i++) { String text = name.substring(i, i + 1); if (!isLetter(text) && !isNumber(text) && !text.contains("_") && !text.contains("-") && !text.contains(".")) { return false; } } return true; } else { return false; } }  static boolean validate(String name);  }### Answer:
@Test public void testStartWithLetter() throws Exception { assertTrue(XsdIDValidator.validate("test")); }
@Test public void testStartsWithUnderScore() throws Exception { assertTrue(XsdIDValidator.validate("_test")); }
@Test public void testStartsWithNumber() throws Exception { assertFalse(XsdIDValidator.validate("1test")); }
@Test public void testStartsWithExclamationMark() throws Exception { assertFalse(XsdIDValidator.validate("!test")); }
@Test public void testContainsExclamationMark() throws Exception { assertFalse(XsdIDValidator.validate("test!")); }
@Test public void testColons() throws Exception { assertFalse(XsdIDValidator.validate("test:")); }
@Test public void testSpace() throws Exception { assertFalse(XsdIDValidator.validate("test me")); }
@Test public void testContainsPeriod() throws Exception { assertTrue(XsdIDValidator.validate("test.")); }
@Test public void testUnderscorePeriod() throws Exception { assertTrue(XsdIDValidator.validate("test_me")); }
@Test public void testHyphenPeriod() throws Exception { assertTrue(XsdIDValidator.validate("test-me")); }