### Question:
IndexerNameValidator { public static void validate(String indexerName) { if (indexerName == null || "".equals(indexerName)) { throw new IllegalArgumentException("Indexer name may not be empty"); } if (!INDEXER_NAME_REGEX.matcher(indexerName).matches()) { throw new IllegalArgumentException(String.format("Invalid indexer name '%s', must be alpha-numeric", indexerName)); } }  static void validate(String indexerName);  }### Answer:
@Test public void testValidate_Valid() { IndexerNameValidator.validate("this_is_1_valid_index"); }
@Test(expected=IllegalArgumentException.class) public void testValidate_Null() { IndexerNameValidator.validate(null); }
@Test(expected=IllegalArgumentException.class) public void testValidate_EmptyName() { IndexerNameValidator.validate(""); }
@Test(expected=IllegalArgumentException.class) public void testValidate_NotAlphaNumeric() { IndexerNameValidator.validate("not_alphanumeric!"); }
@Test(expected=IllegalArgumentException.class) public void testValidate_WithSpaces() { IndexerNameValidator.validate("with whitespace"); }