I ran into a similar problem and just passed the end of the array to the ArrayList.add()
index param like so:
public class Stack {
private ArrayList<String> stringList = new ArrayList<String>();
RandomStringGenerator rsg = new RandomStringGenerator();
private void push(){
String random = rsg.randomStringGenerator();
stringList.add(stringList.size(), random);
}
}