public final Map<ShapeId, Shape> connectedShapes() {
        Map<ShapeId, Shape> result = connectedShapes;
        if (result == null) {
            result = new TreeMap<>();
            Iterator<Shape> iterator = new Walker(model).iterateShapes(service);
            while (iterator.hasNext()) {
                Shape next = iterator.next();
                result.put(next.getId(), next);
            }
            connectedShapes = result;
        }
        return result;
    }
@return Returns a map of shapes connected to the service.
smithy-codegen-core/src/main/java/software/amazon/smithy/codegen/core/directed/Directive.java