code: @Override
      public boolean isValid(String value, ConstraintValidatorContext context) {
          try {
              this.duracloudUserService.checkUsername(value);
          } catch (InvalidUsernameException ex) {
              context.disableDefaultConstraintViolation();
              String message;
              if (ex instanceof ReservedUsernameException) {
                  message = RESERVED_USERNAME_MESSAGE;
              } else if (ex instanceof ReservedPrefixException) {
                  message = RESERVED_PREFIX_MESSAGE;
              } else {
                  message = INVALID_USERNAME_MESSAGE;
              }
  
              message = MessageFormat.format(message, value);
              ConstraintViolationBuilder cvb =
                  context.buildConstraintViolationWithTemplate(message);
              cvb.addConstraintViolation();
              return false;
          } catch (UserAlreadyExistsException ex) {
              return false;
          }
  
          return true;
      }
docs: /* (non-Javadoc)
  @see javax.validation.ConstraintValidator#isValid(java.lang.Object, javax.validation.ConstraintValidatorContext)