code: public byte[] toByteArray(final ArrayOfItemsSerDe<T> serDe) {
      if (gadget_ == null) {
        final ItemsSketch<T> sketch = ItemsSketch.getInstance(maxK_, comparator_);
        return sketch.toByteArray(serDe);
      }
      return gadget_.toByteArray(serDe);
    }
docs: Serialize this union to a byte array. Result is an ItemsSketch, serialized in an
  unordered, non-compact form. The resulting byte[] can be passed to getInstance for either a
  sketch or union.
  
  @param serDe an instance of ArrayOfItemsSerDe
  @return byte array of this union