static Set<AnnotatedValueResolver> uniqueResolverSet() {
        return new TreeSet<>((o1, o2) -> {
            String o1Name = o1.httpElementName();
            String o2Name = o2.httpElementName();
            final Class<? extends Annotation> o1AnnotationType = o1.annotationType();
            final Class<? extends Annotation> o2AnnotationType = o2.annotationType();
            if (o1AnnotationType == o2AnnotationType && o1Name.equals(o2Name)) {
                return 0;
            }

            // TreeSet internally creates a binary tree. A consistent comparison for the two inputs is
            // necessary to traverse the binary tree correctly and check uniqueness.
            // If compare(o1, o2) returns -1, compare(o2, o1) should return 1 or a positive number.
            if (o1AnnotationType != null) {
                o1Name += '/' + o1AnnotationType.getName();
            }
            if (o2AnnotationType != null) {
                o2Name += '/' + o2AnnotationType.getName();
            }
            final int result = o1Name.compareTo(o2Name);
            if (result != 0) {
                return result;
            }
            // It is still not a good idea to return 0 since the equality for `httpElementName()` and
            // `annotationType()` is broken. `o1AnnotationType` and `o2AnnotationType` may be the same
            // class, but loaded by two class different loaders. The hash comparison is used to return a
            // non-zero value for the different classes.
            return Ints.compare(Objects.hashCode(o1AnnotationType), Objects.hashCode(o2AnnotationType));
        });
    }
Returns a factory of the specified {@link BeanFactoryId}.
core/src/main/java/com/linecorp/armeria/internal/server/annotation/AnnotatedBeanFactoryRegistry.java