public Optional<RowMapper<?>> findFor(Type type) {
        // ConcurrentHashMap can enter an infinite loop on nested computeIfAbsent calls.
        // Since row mappers can decorate other row 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<RowMapper<?>> cached = cache.get(type);

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

        for (RowMapperFactory factory : factories) {
            Optional<RowMapper<?>> maybeMapper = factory.build(type, registry);
            RowMapper<?> 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 row mapper for the given type in the given context.

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