docs: public Object[] toArray() {
  
          Object[] newArray = (Object[]) Array.newInstance(
              elementData.getClass().getComponentType(), elementCount);
  
          System.arraycopy(elementData, 0, newArray, 0, elementCount);
  
          return newArray;
      }