private static <T extends Node> Collection<T> matchingNodes(Collection<Node> nodes, Class<T> nodeType, Key<?> key) {
        Class<?> clazz = key.getTypeLiteral().getRawType();
        Annotation annotation = key.getAnnotation();

        List<T> filteredByClass = nodesOfType(nodes, nodeType).stream().filter(node -> clazz.isAssignableFrom(node.componentType()))
                .toList();

        if (filteredByClass.size() == 1) {
            return filteredByClass;
        } else {
            List<T> filteredByClassAndAnnotation = filteredByClass.stream()
                    .filter(node -> (annotation == null && node.instanceKey().getAnnotation() == null)
                            || annotation.equals(node.instanceKey().getAnnotation()))
                    .toList();
            if (filteredByClassAndAnnotation.size() > 0) {
                return filteredByClassAndAnnotation;
            } else {
                return filteredByClass;
            }
        }
    }
All constructed components and providers of this, in reverse creation order, i.e., suited for ordered deconstruction.
container-core/src/main/java/com/yahoo/container/di/componentgraph/core/ComponentGraph.java