@Deprecated
    static <S extends Shape, T extends Trait> Stream<Pair<S, T>> flatMapStream(
            S shape,
            Class<T> traitClass
    ) {
        return OptionalUtils.stream(shape.getTrait(traitClass).map(t -> Pair.of(shape, t)));
    }
Used in a stream flatMapStream to return a {@link Stream} with a
{@link Pair} of Shape and Trait if the trait is present on the
given shape.

<p>This method is deprecated because it generally results in harder
to read code using unnamed tuples. Use {@link Shape#hasTrait(Class)}
and {@link Shape#expectTrait(Class)} instead.

@param shape Shape to query for the trait.
@param traitClass Trait to retrieve.
@param <S> Shape
@param <T> Trait
@return Returns the Stream of the found trait or an empty stream.
smithy-model/src/main/java/software/amazon/smithy/model/traits/Trait.java