@SuppressWarnings("unchecked")
    public static <O, T> Optional<Attribute<O, T>> get(Set<Attribute<O, ?>> attributes, String name) {
        return attributes.stream()
                .filter(a -> a.name.equals(name))
                .map(a -> (Attribute<O, T>) a)
                .findFirst();
    }
For pseudo-attributes which are actually managed directly as singletons, not set on some owner component
plugin/src/main/java/io/jenkins/plugins/casc/Attribute.java