code: protected <COLLECTION extends Collection> CollectionFactory registerCollectionFactory(CollectionFactory<? extends COLLECTION> factory,
        Class<COLLECTION> collectionInterface) {
  
      if (!collectionInterface.isAssignableFrom(factory.getCollectionInterface())) {
        throw new IllegalArgumentException();
      }
      return this.collectionFactoryMap.put(collectionInterface, factory);
    }
docs: This method registers the given {@code factory} for the given {@code collectionInterface}.
  
  @param <COLLECTION> is the generic type of the {@code collectionInterface}.
  @param factory is the {@link CollectionFactory} to register.
  @param collectionInterface is the interface of the associated {@link Collection}. It has to be
  {@link Class#isAssignableFrom(Class) assignable from} the {@link CollectionFactory#getCollectionInterface()
  collection-interface} of the given {@code factory}.
  @return the {@link CollectionFactory} that was registered for the given {@code collectionInterface} before and has
  now been replaced with {@code factory} or {@code null} if none was replaced.