@SuppressWarnings("unchecked")
  public static <S, F> S visit(final SqlType type, final SqlTypeWalker.Visitor<S, F> visitor) {
    final BiFunction<SqlTypeWalker.Visitor<?, ?>, SqlType, Object> handler = HANDLER
        .get(type.baseType());

    if (handler == null) {
      throw new UnsupportedOperationException("Unsupported schema type: " + type.baseType());
    }

    return (S) handler.apply(visitor, type);
  }
@Test
  public void shouldVisitDecimal() {
    // Given:
    final SqlDecimal type = SqlTypes.decimal(10, 2);
    when(visitor.visitDecimal(any())).thenReturn("Expected");

    // When:
    final String result = SqlTypeWalker.visit(type, visitor);

    // Then:
    verify(visitor).visitDecimal(same(type));
    assertThat(result, is("Expected"));
  }