public int get(int i) {
    if (i < 0 || i >= size) {
      throw new IndexOutOfBoundsException("Invalid stack index " + i + " for stack of size " + size);
    }
    return data[i];
  }
public int get(int i)