@SuppressWarnings({ "unchecked", "rawtypes", "PMD.UnnecessaryCast" })
    public <T> Optional<ColumnMapper<T>> findFor(QualifiedType<T> type) {
        // ConcurrentHashMap can enter an infinite loop on nested computeIfAbsent calls.
        // Since column mappers can decorate other column mappers, we have to populate the cache the old fashioned way.
        // See https://bugs.openjdk.java.net/browse/JDK-8062841, https://bugs.openjdk.java.net/browse/JDK-8142175
        Optional<ColumnMapper<T>> cached = (Optional) cache.get(type);

        if (cached != null) {
            return cached;
        }

        for (QualifiedColumnMapperFactory factory : factories) {
            Optional<ColumnMapper<T>> maybeMapper = (Optional) factory.build(type, registry);
            ColumnMapper<T> mapper = maybeMapper.orElse(null);
            if (mapper != null) {
                mapper.init(registry);
                cache.put(type, maybeMapper);
                return maybeMapper;
            }
        }

        cache.put(type, Optional.empty());
        return Optional.empty();
    }
Obtain a column mapper for the given qualified type.

@param type the qualified target type to map to
@return a ColumnMapper for the given type, or empty if no column mapper is registered for the given type.
core/src/main/java/org/jdbi/v3/core/mapper/ColumnMappers.java