code: static <T> AvroFactory<T> create(Class<T> type, @Nullable Schema currentSchema, @Nullable Schema previousSchema) {
  		final ClassLoader cl = Thread.currentThread().getContextClassLoader();
  
  		if (SpecificRecord.class.isAssignableFrom(type)) {
  			return fromSpecific(type, cl, Optional.ofNullable(previousSchema));
  		}
  		if (GenericRecord.class.isAssignableFrom(type)) {
  			return fromGeneric(cl, currentSchema);
  		}
  		return fromReflective(type, cl, Optional.ofNullable(previousSchema));
  	}
docs: Creates Avro Writer and Reader for a specific type.
  
  <p>Given an input type, and possible the current schema, and a previously known schema (also known as writer
  schema) create will deduce the best way to initalize a reader and writer according to the following rules:
  <ul>
  <li>If type is an Avro generated class (an {@link SpecificRecord} then the reader would use the
  previousSchema for reading (if present) otherwise it would use the schema attached to the auto generated
  class.
  <li>If the type is a GenericRecord then the reader and the writer would be created with the supplied
  (mandatory) schema.
  <li>Otherwise, we use Avro's reflection based reader and writer that would deduce the schema via reflection.
  If the previous schema is also present (when restoring a serializer for example) then the reader would be
  created with both schemas.
  </ul>