private boolean isSingularReference(NeighborProvider reverse, Shape shape, Shape expectedReferencingShape) {
        // We need to exclude inverted edges like MEMBER_CONTAINER, and only look for directed
        // edges to the expected shape.
        return reverse.getNeighbors(shape)
                .stream()
                .filter(relationship -> relationship.getDirection() == RelationshipDirection.DIRECTED)
                .allMatch(relationship -> relationship.getShape().equals(expectedReferencingShape));
    }
@see ModelTransformer#createDedicatedInputAndOutput(Model, String, String)
smithy-model/src/main/java/software/amazon/smithy/model/transform/CreateDedicatedInputAndOutput.java