@NotNull
@Override
public Map<K, V> process(@NotNull ResultSet resultSet) throws SQLException {
Map<K,V> result = new LinkedHashMap<K,V>();
NamedTypeList types = ResultSetUtils.getTypes(resultSet.getMetaData());
if (types.size() != 2)
throw new UnexpectedResultException("Expected ResultSet with 2 columns, but got " + types.size() + " columns.");
TypeConversion<Object, K> keyConversion = getConversion(types.getType(0), keyType);
TypeConversion<Object, V> valueConversion = getConversion(types.getType(1), valueType);
while (resultSet.next()) {
K key = convert(keyConversion, resultSet.getObject(1));
V value = convert(valueConversion, resultSet.getObject(2));
//noinspection ConstantConditions