public static Stream<Class<?>> superTypes(Class<?> type) {
        Class<?>[] interfaces = type.getInterfaces();
        // collect into a set to deduplicate the classes found.
        // this can happen if e.g. a extends b and both implement c.
        Set<Class<?>> result = Stream.concat(
                        Arrays.stream(interfaces).flatMap(JdbiClassUtils::superTypes),
                        Arrays.stream(interfaces))
                .collect(Collectors.toSet());

        return result.stream();
    }
Returns all supertypes to a given type.

@param type A type
@return A {@link Stream} of {@link Class} objects
core/src/main/java/org/jdbi/v3/core/internal/JdbiClassUtils.java