@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 shouldThrowOnUnknownType() {
    // Given:
    final SqlBaseType unknownType = mock(SqlBaseType.class, "bob");
    final SqlType type = mock(SqlType.class);
    when(type.baseType()).thenReturn(unknownType);

    // When:
    final UnsupportedOperationException e = assertThrows(
        UnsupportedOperationException.class,
        () -> SqlTypeWalker.visit(type, visitor)
    );

    // Then:
    assertThat(e.getMessage(), containsString(
        "Unsupported schema type: bob"
    ));
  }