code: @SuppressWarnings("unchecked")
    public static <E> Class<E> resolveType(Class<E> type, Schema schema) {
      if (type == Object.class) {
        type = ReflectData.get().getClass(schema);
      }
  
      if (type == null) {
        type = (Class<E>) GenericData.Record.class;
      }
  
      return type;
    }
docs: Resolves the type based on the given schema. In most cases, the type should
  stay as is. However, if the type is Object, then that means that the old
  default behavior of determining the class from ReflectData#getClass(Schema)
  should be used. If a class can't be found, it will default to
  GenericData.Record.
  
  @param <E> The entity type
  @param type The Java class of the entity type
  @param schema The {@link Schema} for the entity
  @return The resolved Java class object