public static TreeSet<Class<?>> getAllInterfaces(Class<?> cls) {
        final TreeSet<Class<?>> interfacesFound = new TreeSet<>(
            (c1, c2) -> {
                if (c1.equals(c2)) {
                    return 0;
                } else if (c1.isAssignableFrom(c2)) {
                    return 1;
                } else {
                    return -1;
                }
            }
        );
        getAllInterfaces(cls, interfacesFound);
        return interfacesFound;
    }
Returns a set of all interfaces defined for {@code cls}.
Interfaces are sorted from lowest to highest level (i.e. children before parents)
core/src/main/java/com/linecorp/armeria/internal/common/util/Types.java