code: @SuppressWarnings("unchecked")
    private T[] getDataSamples(final Class<?> clazz) {
      assert (h_ + r_) > 0;
  
      // are 2 Array.asList(data_.subList()) copies better?
      final T[] prunedList = (T[]) Array.newInstance(clazz, getNumSamples());
      int i = 0;
      for (T item : data_) {
        if (item != null) {
          prunedList[i++] = item;
        }
      }
      return prunedList;
    }
docs: Returns a copy of the items (no weights) in the sketch as members of Class <em>clazz</em>,
  or null if empty. The returned array length may be smaller than the total capacity.
  
  <p>This method allocates an array of class <em>clazz</em>, which must either match or
  extend T. This method should be used when objects in the array are all instances of T but
  are not necessarily instances of the base class.</p>
  
  @param clazz A class to which the items are cast before returning
  @return A copy of the sample array