code: @SuppressWarnings("unchecked")
      private void ensureCapacity(int capacity) {
          checkCapacity(capacity);
          Elem<V>[] newArray = (Elem<V>[]) Array.newInstance(Elem.class, capacity + 2);
          if (newArray.length >= array.length) {
              System.arraycopy(array, 0, newArray, 0, array.length);
              for (int i = array.length; i < newArray.length; i++) {
                  newArray[i] = new Elem<V>(SUP_KEY, null);
              }
          } else {
              System.arraycopy(array, 0, newArray, 0, newArray.length);
          }
          array = newArray;
      }
docs: Ensure that the array representation has the necessary capacity.
  
  @param capacity
  the requested capacity