@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 shouldVisitPrimitives() {
    // Given:
    visitor = new Visitor<String, Integer>() {
      @Override
      public String visitPrimitive(final SqlPrimitiveType type) {
        return "Expected";
      }
    };

    primitiveTypes().forEach(type -> {

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

      // Then:
      assertThat(result, is("Expected"));
    });
  }