@SuppressWarnings("unchecked")
    private <E extends Gen<?>> E instantiateGenerator(Class<E> genClass, Gen[] subGenerators)
    {
        Class[] subGenClasses = new Class[subGenerators == null ? 0 : subGenerators.length];
        Arrays.fill(subGenClasses, Gen.class);
        
        try {
            if (subGenClasses.length == 0) {
                return genClass.newInstance();
            }
            else {
                Constructor constr = genClass.getConstructor(subGenClasses);
                return (E) constr.newInstance((Object[])subGenerators);
            }
        }
        catch (InstantiationException ex) {
            unableToInstantiateGenerator(genClass, ex);
        }
        catch (IllegalAccessException ex) {
            unableToInstantiateGenerator(genClass, ex);
        }
        catch (IllegalArgumentException ex) {
            unableToInstantiateGenerator(genClass, ex);
        }
        catch (InvocationTargetException ex) {
            unableToInstantiateGenerator(genClass, ex);
        }
        catch (NoSuchMethodException ex) {
            unableToInstantiateGenerator(genClass, ex);
        }
        catch (SecurityException ex) {
            unableToInstantiateGenerator(genClass, ex);
        }
        
        // Should never happen
        return null;
    }