@SuppressWarnings("unchecked")
  public static <S, F> S visit(final Schema schema, final Visitor<S, F> visitor) {
    final BiFunction<Visitor<?, ?>, Schema, Object> handler = HANDLER.get(schema.type());
    if (handler == null) {
      throw new UnsupportedOperationException("Unsupported schema type: " + schema.type());
    }

    return (S) handler.apply(visitor, schema);
  }
@Test
  public void shouldThrowOnUnknownType() {
    // Given:
    final Type unknownType = mock(Type.class, "bob");
    final Schema schema = mock(Schema.class);
    when(schema.type()).thenReturn(unknownType);

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

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