  @Test
  public void extendedBucketNameValidatorTest() throws Exception {

    String restriction = "extended";
    String largeName = String.format("%0" + 10 + "d", 0).replace("0", "abcdefghij");
    assertTrue("expected that a " + largeName.length() + "-character name would be okay", BucketNameValidatorRepo.getBucketNameValidator(restriction)
        .check(largeName));
    largeName = String.format("%0" + 30 + "d", 0).replace("0", "abcdefghij");
    assertTrue("expected that a " + largeName.length() + "-character name would not be okay",
        !BucketNameValidatorRepo.getBucketNameValidator(restriction).check(largeName));
    String badName = "foo#bar";
    assertTrue("expected that the name " + badName + " would not be okay", !BucketNameValidatorRepo.getBucketNameValidator(restriction)
        .check(badName));
    badName = "foo bar";
    assertTrue("expected that the name " + badName + " would not be okay", !BucketNameValidatorRepo.getBucketNameValidator(restriction)
        .check(badName));
    badName = "foo@bar";
    assertTrue("expected that the name " + badName + " would not be okay", !BucketNameValidatorRepo.getBucketNameValidator(restriction)
        .check(badName));
    badName = "foo,bar";
    assertTrue("expected that the name " + badName + " would not be okay", !BucketNameValidatorRepo.getBucketNameValidator(restriction)
        .check(badName));
  }