// Path: dalesbred/src/main/java/org/dalesbred/internal/utils/TypeUtils.java
// public final class TypeUtils {
// 
//     private TypeUtils() { }
// 
//     public static @NotNull Class<?> rawType(@NotNull Type type) {
//         if (type instanceof Class<?>) {
//             return (Class<?>) type;
// 
//         } else if (type instanceof ParameterizedType) {
//             return rawType(((ParameterizedType) type).getRawType());
// 
//         } else if (type instanceof TypeVariable<?>) {
//             // We could return one of the bounds, but it won't work if there are multiple bounds.
//             // Therefore just return object.
//             return Object.class;
// 
//         } else if (type instanceof WildcardType) {
//             return rawType(((WildcardType) type).getUpperBounds()[0]);
// 
//         } else if (type instanceof GenericArrayType) {
//             return arrayType(rawType(((GenericArrayType) type).getGenericComponentType()));
// 
//         } else {
//             throw new IllegalArgumentException("unexpected type: " + type);
//         }
//     }
// 
//     public static @NotNull Type typeParameter(@NotNull Type type) {
//         if (type instanceof ParameterizedType)
//             return ((ParameterizedType) type).getActualTypeArguments()[0];
// 
//         return Object.class;
//     }
// 
//     public static boolean isEnum(@NotNull Type type) {
//         return (type instanceof Class<?>) && ((Class<?>) type).isEnum();
//     }
// 
//     public static boolean isPrimitive(@NotNull Type type) {
//         return (type instanceof Class<?>) && ((Class<?>) type).isPrimitive();
//     }
// 
//     public static @NotNull Class<?> arrayType(@NotNull Class<?> type) {
//         return Array.newInstance(type, 0).getClass();
//     }
// 
//     public static @Nullable Type genericSuperClass(@NotNull Type type) {
//         return rawType(type).getGenericSuperclass();
//     }
// 
//     public static @NotNull Type[] genericInterfaces(@NotNull Type type) {
//         return rawType(type).getGenericInterfaces();
//     }
// 
//     public static boolean isAssignable(@NotNull Type target, @NotNull Type source) {
//         // TODO: implement proper rules for generic types
//         return isAssignableByBoxing(rawType(target), rawType(source));
//     }
// 
//     private static boolean isAssignableByBoxing(@NotNull Class<?> target, @NotNull Class<?> source) {
//         return Primitives.wrap(target).isAssignableFrom(Primitives.wrap(source));
//     }
// }
// 
// Path: dalesbred/src/main/java/org/dalesbred/internal/utils/CollectionUtils.java
// public static @NotNull <A,B> List<B> mapToList(@NotNull Collection<? extends A> xs, @NotNull Function<? super A, ? extends B> mapper) {
//     return xs.stream().map(mapper).collect(toListWithCapacity(xs.size()));
// }


import static java.util.Collections.unmodifiableList;
import static java.util.Objects.requireNonNull;
import static org.dalesbred.internal.utils.CollectionUtils.mapToList;
import org.dalesbred.internal.utils.TypeUtils;
import org.jetbrains.annotations.NotNull;
import java.io.IOException;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
            this.type = requireNonNull(type);
            this.jdbcType = jdbcType;
            this.databaseType = requireNonNull(databaseType);
        }

        /**
         * Returns the zero-based index of this column.
         */
        public int getIndex() {
            return index;
        }

        /**
         * Returns the name of this column.
         */
        public @NotNull String getName() {
            return name;
        }

        /**
         * Returns the Java-type of this column.
         */
        public @NotNull Type getType() {
            return type;
        }

        /**
         * Returns the raw Java-type of this column.
         */
        public @NotNull Class<?> getRawType() {
// Path: dalesbred/src/main/java/org/dalesbred/internal/utils/TypeUtils.java
// public final class TypeUtils {
// 
//     private TypeUtils() { }
// 
//     public static @NotNull Class<?> rawType(@NotNull Type type) {
//         if (type instanceof Class<?>) {
//             return (Class<?>) type;
// 
//         } else if (type instanceof ParameterizedType) {
//             return rawType(((ParameterizedType) type).getRawType());
// 
//         } else if (type instanceof TypeVariable<?>) {
//             // We could return one of the bounds, but it won't work if there are multiple bounds.
//             // Therefore just return object.
//             return Object.class;
// 
//         } else if (type instanceof WildcardType) {
//             return rawType(((WildcardType) type).getUpperBounds()[0]);
// 
//         } else if (type instanceof GenericArrayType) {
//             return arrayType(rawType(((GenericArrayType) type).getGenericComponentType()));
// 
//         } else {
//             throw new IllegalArgumentException("unexpected type: " + type);
//         }
//     }
// 
//     public static @NotNull Type typeParameter(@NotNull Type type) {
//         if (type instanceof ParameterizedType)
//             return ((ParameterizedType) type).getActualTypeArguments()[0];
// 
//         return Object.class;
//     }
// 
//     public static boolean isEnum(@NotNull Type type) {
//         return (type instanceof Class<?>) && ((Class<?>) type).isEnum();
//     }
// 
//     public static boolean isPrimitive(@NotNull Type type) {
//         return (type instanceof Class<?>) && ((Class<?>) type).isPrimitive();
//     }
// 
//     public static @NotNull Class<?> arrayType(@NotNull Class<?> type) {
//         return Array.newInstance(type, 0).getClass();
//     }
// 
//     public static @Nullable Type genericSuperClass(@NotNull Type type) {
//         return rawType(type).getGenericSuperclass();
//     }
// 
//     public static @NotNull Type[] genericInterfaces(@NotNull Type type) {
//         return rawType(type).getGenericInterfaces();
//     }
// 
//     public static boolean isAssignable(@NotNull Type target, @NotNull Type source) {
//         // TODO: implement proper rules for generic types
//         return isAssignableByBoxing(rawType(target), rawType(source));
//     }
// 
//     private static boolean isAssignableByBoxing(@NotNull Class<?> target, @NotNull Class<?> source) {
//         return Primitives.wrap(target).isAssignableFrom(Primitives.wrap(source));
//     }
// }
// 
// Path: dalesbred/src/main/java/org/dalesbred/internal/utils/CollectionUtils.java
// public static @NotNull <A,B> List<B> mapToList(@NotNull Collection<? extends A> xs, @NotNull Function<? super A, ? extends B> mapper) {
//     return xs.stream().map(mapper).collect(toListWithCapacity(xs.size()));
// }


// Path: dalesbred/src/main/java/org/dalesbred/result/ResultTable.java
import static java.util.Collections.unmodifiableList;
import static java.util.Objects.requireNonNull;
import static org.dalesbred.internal.utils.CollectionUtils.mapToList;
import org.dalesbred.internal.utils.TypeUtils;
import org.jetbrains.annotations.NotNull;
import java.io.IOException;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

            this.type = requireNonNull(type);
            this.jdbcType = jdbcType;
            this.databaseType = requireNonNull(databaseType);
        }

        /**
         * Returns the zero-based index of this column.
         */
        public int getIndex() {
            return index;
        }

        /**
         * Returns the name of this column.
         */
        public @NotNull String getName() {
            return name;
        }

        /**
         * Returns the Java-type of this column.
         */
        public @NotNull Type getType() {
            return type;
        }

        /**
         * Returns the raw Java-type of this column.
         */
        public @NotNull Class<?> getRawType() {
            return TypeUtils.rawType(type);