private void ensureCapacity(int minCapacity) {
    int oldCapacity = myData.length;
    if (minCapacity > oldCapacity){
      char[] oldData = myData;
      int newCapacity = oldCapacity * 3 / 2 + 1;
      if (newCapacity < minCapacity){
        newCapacity = minCapacity;
      }
      myData = new char[newCapacity];
      System.arraycopy(oldData, 0, myData, 0, mySize);
    }
  }
private void ensureCapacity(int minCapacity)