@Override
    @SuppressWarnings("unchecked")
    public Optional<ColumnMapper<?>> build(Type type, ConfigRegistry config) {
        final Class<?> erasedType = GenericTypes.getErasedType(type);

        if (erasedType.isArray()) {
            Class<?> elementType = erasedType.getComponentType();
            return elementTypeMapper(elementType, config)
                    .map(elementMapper -> new ArrayColumnMapper(elementMapper, elementType));
        }

        JdbiCollectors collectorRegistry = config.get(JdbiCollectors.class);
        return (Optional) collectorRegistry.findFor(type)
                .flatMap(collector -> collectorRegistry.findElementTypeFor(type)
                        .flatMap(elementType -> elementTypeMapper(elementType, config))
                        .map(elementMapper -> new CollectorColumnMapper(elementMapper, collector)));
    }
Maps SQL array columns into Java arrays or other Java container types.
Supports any Java array type for which a {@link ColumnMapper} is registered
for the array element type. Supports any other container type for which a
{@link org.jdbi.v3.core.collector.CollectorFactory} is registered, and for which
a {@link ColumnMapper} is registered for the container element type.
core/src/main/java/org/jdbi/v3/core/array/SqlArrayMapperFactory.java