private static Trait extractTrait(Shape shape, Trait defaultValue) {
        return shape.getTrait(MockIntegrationTrait.class)
                .map(trait -> (Trait) trait)
                .orElseGet(() -> shape.getTrait(IntegrationTrait.class)
                        .map(trait -> (Trait) trait)
                        .orElse(defaultValue));
    }
Get the integration trait for a particular operation, resource, or
service bound within a service of a specific type.

@param service Service shape or ShapeId thereof.
@param shape Operation, service, or resource shape in the service.
 When the service shape ID is provided, the integration trait of the
 service is returned if present.
@param type Integration trait type.
@param <T> Type of trait to retrieve.

@return The integration trait or an empty optional if none set or
 if not of the expected type.
smithy-aws-apigateway-traits/src/main/java/software/amazon/smithy/aws/apigateway/traits/IntegrationTraitIndex.java