@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 shouldVisitInt16() {
    // Given:
    final Schema schema = Schema.OPTIONAL_INT16_SCHEMA;
    when(visitor.visitInt16(any())).thenReturn("Expected");

    // When:
    final String result = SchemaWalker.visit(schema, visitor);

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