if (a.length < size) a = (T[]) Array.newInstance(a.getClass().getComponentType(), size); else if (a.length > size) a[size] = null; System.arraycopy(data, 0, a, 0, size); return a;
E[] array = (E[]) new Object[size]; System.arraycopy(data, 0, array, 0, size); return array;
  public <T> T[] toArray(T[] a)  {    if (a.length < size)      a = (T[]) Array.newInstance(a.getClass().getComponentType(), size);    else if (a.length > size)      a[size] = null;    System.arraycopy(data, 0, a, 0, size);    return a;  }