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

    primitiveSchemas().forEach(schema -> {

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

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