public static void validateServiceId(String serviceId) {
        if (isPreviouslyReleasedInvalidServiceId(serviceId)) {
            return;
        }

        List<String> messages = new ArrayList<>();

        if (!validForPattern(serviceId)) {
            messages.add(String.format("Does not match the required pattern `%s`", SERVICE_ID_PATTERN.pattern()));
        }

        if (containsCompanyName(serviceId)) {
            messages.add(String.format(
                    "Must not contain any of the following company names: [%s]",
                    ValidationUtils.tickedList(COMPANY_NAMES)));
        }

        endsWithForbiddenWord(serviceId).ifPresent(suffix -> {
            messages.add(String.format("Must not case-insensitively end with `%s`", suffix));
        });

        if (serviceId.isEmpty() || serviceId.length() > 50) {
            messages.add("Must be between 1 and 50 characters long.");
        }

        if (!messages.isEmpty()) {
            throw new IllegalArgumentException(String.format(
                    "Invalid SDK service ID value, `%s`: %s",
                    serviceId,
                    String.join(";", messages)));
        }
    }
Validates a service ID value.

@param serviceId Service ID to validate.
@throws IllegalArgumentException if the service ID is invalid.
smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/SdkServiceIdValidator.java