@SuppressWarnings("unchecked")
    public <T extends Trait> Optional<Pair<T, T>> getChangedTrait(Class<T> traitType) {
        return changedTraits()
                .filter(p -> traitType.isInstance(p.getLeft()) && traitType.isInstance(p.getRight()))
                .map(p -> (Pair<T, T>) p)
                .findFirst();
    }
Gets a changed trait of a specific type.

@param traitType Type of trait to find.
@param <T> Type of trait to find.
@return Returns the optionally found old and new typed trait values.
smithy-diff/src/main/java/software/amazon/smithy/diff/ChangedShape.java