code: public static <S extends Summary> Sketch<S> heapifySketch(final Memory mem,
        final SummaryDeserializer<S> deserializer) {
      final SerializerDeserializer.SketchType sketchType = SerializerDeserializer.getSketchType(mem);
      if (sketchType == SerializerDeserializer.SketchType.QuickSelectSketch) {
        return new QuickSelectSketch<S>(mem, deserializer, null);
      }
      return new CompactSketch<S>(mem, deserializer);
    }
docs: Instantiate Sketch from a given Memory
  @param <S> Type of Summary
  @param mem Memory object representing a Sketch
  @param deserializer instance of SummaryDeserializer
  @return Sketch created from its Memory representation