@SuppressWarnings("unchecked")
  private void extendStack(int argSize) {
    T[] newStack = (T[]) Array.newInstance(sClass, argSize);
    if (stack != null) {
      System.arraycopy(stack, 0, newStack, 0, size);
    }
    for (int i = 0; i < newStack.length; i++) {
      try {
        if (params != null) {
          newStack[i] = sClass.getConstructor(params).newInstance(args);
        } else {
          newStack[i] = sClass.newInstance();
        }
      } catch (InstantiationException e) {
        log.error("Error creating pooled object " + sClass.getSimpleName(), e);
        assert (false) : "Error creating pooled object " + sClass.getCanonicalName();
      } catch (IllegalAccessException e) {
        log.error("Error creating pooled object " + sClass.getSimpleName(), e);
        assert (false) : "Error creating pooled object " + sClass.getCanonicalName();
      } catch (IllegalArgumentException e) {
        log.error("Error creating pooled object " + sClass.getSimpleName(), e);
        assert (false) : "Error creating pooled object " + sClass.getCanonicalName();
      } catch (SecurityException e) {
        log.error("Error creating pooled object " + sClass.getSimpleName(), e);
        assert (false) : "Error creating pooled object " + sClass.getCanonicalName();
      } catch (InvocationTargetException e) {
        log.error("Error creating pooled object " + sClass.getSimpleName(), e);
        assert (false) : "Error creating pooled object " + sClass.getCanonicalName();
      } catch (NoSuchMethodException e) {
        log.error("Error creating pooled object " + sClass.getSimpleName(), e);
        assert (false) : "Error creating pooled object " + sClass.getCanonicalName();
      }
    }
    stack = newStack;
    size = newStack.length;
  }