private Collection<String> computeTargetSuggestions(Model model, ShapeId target) {
        String targetString = target.toString();
        int floor = Integer.MAX_VALUE;
        // Sort the result to create deterministic error messages.
        Set<String> candidates = new TreeSet<>();

        for (Shape shape : model.toSet()) {
            String idString = shape.getId().toString();
            int distance = StringUtils.levenshteinDistance(targetString, idString, MAX_EDIT_DISTANCE_FOR_SUGGESTIONS);
            if (distance == floor) {
                // Add to the list of candidates that have the same distance.
                candidates.add(idString);
            } else if (distance > -1 && distance < floor) {
                // Found a new ID that has a lower distance. Set the new floor,
                // clear out the previous candidates, and add this ID.
                floor = distance;
                candidates.clear();
                candidates.add(idString);
            }
        }

        return candidates;
    }
Validates that neighbors target resolvable shapes of the correct type.
smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/TargetValidator.java