@Override
    protected final boolean matchesSafely(ShapeId id) {
        if (!result.getResult().isPresent()) {
            return false;
        }

        return result.getResult()
                .flatMap(model -> model.getShape(id))
                .filter(shapeType::isInstance)
                .map(shapeType::cast)
                .filter(s -> {
                    for (Pair<Predicate<S>, Function<S, String>> pair : assertions) {
                        if (!pair.left.test(s)) {
                            return false;
                        }
                    }
                    return true;
                })
                .isPresent();
    }
Creates a matcher that ensures a member is not marked with @default or @required.

@param result The validated result to check.
@return Returns the created matcher.
smithy-model/src/test/java/software/amazon/smithy/model/ShapeMatcher.java