public <T, Y> void register(Class<T> modelClass, Class<Y> resourceClass, ModelLoaderFactory<T, Y> factory) {
        ModelLoaderFactory<T, Y> removed = loaderFactory.register(modelClass, resourceClass, factory);
        if (removed != null) {
            removed.teardown();
        }
    }
Use the given factory to build a {@link ModelLoader} for models of the given class. Generally the best use of
this method is to replace one of the default factories or add an implementation for other similar low level
models. Typically the {@link RequestManager#using(com.bumptech.glide.load.model.stream.StreamModelLoader)} or
{@link RequestManager#using(com.bumptech.glide.load.model.file_descriptor.FileDescriptorModelLoader)} syntax is
preferred because it directly links the model with the ModelLoader being used to load it. Any factory replaced
by the given factory will have its {@link ModelLoaderFactory#teardown()}} method called.

<p>
    Note - If a factory already exists for the given class, it will be replaced. If that factory is not being
    used for any other model class, {@link ModelLoaderFactory#teardown()}
    will be called.
</p>

<p>
    Note - The factory must not be an anonymous inner class of an Activity or another object that cannot be
    retained statically.
</p>

@see RequestManager#using(com.bumptech.glide.load.model.file_descriptor.FileDescriptorModelLoader)
@see RequestManager#using(com.bumptech.glide.load.model.stream.StreamModelLoader)

@param modelClass The model class.
@param resourceClass The resource class the model loader will translate the model type into.
@param factory The factory to use.
@param <T> The type of the model.
@param <Y> the type of the resource.
core/src/main/java/com/bumptech/glide/Glide.java