code: public static boolean isConsistentWithExpectedType(Schema.Type type,
                                                       Class<?> expectedClass) {
      Class<?> typeClass = TYPE_TO_CLASS.get(type);
      return typeClass != null && expectedClass.isAssignableFrom(typeClass);
    }
docs: Checks that a schema type should produce an object of the expected class.
  
  This check uses {@link Class#isAssignableFrom(Class)}.
  
  @param type an avro Schema.Type
  @param expectedClass a java class
  @return {@code true} if the type produces objects assignable to the class,
  {@code false} if the class is not assignable from the avro type.