class StackValidator {

    public void validate(Stack subject, ValidationResult.ValidationResultBuilder validationBuilder) {
        if (CollectionUtils.isEmpty(subject.getInstanceGroups())) {
            validationBuilder.error("Stack request must contain instance groups.");
        }
        validateTemplates(subject, validationBuilder);
        validateEncryptionKey(subject, validationBuilder);
    }

}