code: public ContextFactory toCreate(BiFunction<Constructor, Object[], Object> function) {
      return new ContextFactory(this.context, function);
    }
docs: Changes the way the objects are created by using the given function.
  
  @param function the function to use for creating the objects.
  @return a new ContextFactory that uses the given function and this context