code: @SuppressWarnings("unchecked")
    public <E,F extends E> F createInstance(Class<E> type, Object... params) {
      Object obj = createInstance(params);
      if (type.isInstance(obj)) {
        return (F) obj;
      } else {
        throw new ClassCreationException("Cannot cast " + classname
            + " into " + type.getName());
      }
    }
docs: Creates an instance of the class, forcing a cast to a certain type and
  given an array of objects as constructor parameters NOTE: the resulting
  instance will [unlike java] invoke the most narrow constructor rather
  than the one which matches the signature passed to this function
  
  @param <E>
  The type of the object returned
  @param type
  The class of the object returned
  @param params
  The arguments to the constructor of the class
  @return An instance of the class