code: public <T> T[] toArrayCached(T[] a) {
          T[] readCacheArray = generatedCacheMap.values().toArray(a);
          T[] writeCacheArray = resultSetCacheMap.values().toArray(a);
  
          T[] combinedCacheArray = (T[]) java.lang.reflect.Array.
                  newInstance(a.getClass().getComponentType(), readCacheArray.length + writeCacheArray.length);
  
          System.arraycopy(readCacheArray, 0, combinedCacheArray, 0, readCacheArray.length);
          System.arraycopy(writeCacheArray, 0, combinedCacheArray, readCacheArray.length, writeCacheArray.length);
  
          return combinedCacheArray;
      }
docs: The same as {@link #toArrayCached()}. Returns array of cached elements(inc. header as first element)
  as array of Type T.
  
  @param a the array into which the elements of this list are to be stored, if it is big enough;
  otherwise, a new array of the same runtime type is allocated for this purpose.
  @return array of cached elements as array of Type T.