You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@datasketches.apache.org by le...@apache.org on 2022/10/19 06:17:10 UTC

[datasketches-java] branch exceptions_on_empty created (now 3e176df1)

This is an automated email from the ASF dual-hosted git repository.

leerho pushed a change to branch exceptions_on_empty
in repository https://gitbox.apache.org/repos/asf/datasketches-java.git


      at 3e176df1 throwing exceptions instead of returning null or Nan when sketch is empty.

This branch includes the following new commits:

     new 3e176df1 throwing exceptions instead of returning null or Nan when sketch is empty.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datasketches.apache.org
For additional commands, e-mail: commits-help@datasketches.apache.org


[datasketches-java] 01/01: throwing exceptions instead of returning null or Nan when sketch is empty.

Posted by le...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

leerho pushed a commit to branch exceptions_on_empty
in repository https://gitbox.apache.org/repos/asf/datasketches-java.git

commit 3e176df1adca7dbe610ec8025165cc37a5833a53
Author: Lee Rhodes <le...@users.noreply.github.com>
AuthorDate: Tue Oct 18 23:17:01 2022 -0700

    throwing exceptions instead of returning null or Nan when sketch is
    empty.
    
    These changes rippled throughout all the quantiles sketches.
---
 .../org/apache/datasketches/hll/TgtHllType.java    |  1 -
 .../apache/datasketches/kll/KllDoublesHelper.java  |  4 +-
 .../apache/datasketches/kll/KllDoublesSketch.java  | 25 +++++---
 .../kll/KllDoublesSketchSortedView.java            |  8 +++
 .../apache/datasketches/kll/KllFloatsHelper.java   |  4 +-
 .../apache/datasketches/kll/KllFloatsSketch.java   | 25 +++++---
 .../kll/KllFloatsSketchSortedView.java             |  8 +++
 .../org/apache/datasketches/kll/KllSketch.java     |  1 -
 .../quantiles/DirectCompactDoublesSketch.java      | 13 ++--
 .../quantiles/DirectUpdateDoublesSketch.java       | 12 ++--
 .../quantiles/DirectUpdateDoublesSketchR.java      | 11 ++--
 .../quantiles/DoublesByteArrayImpl.java            |  4 +-
 .../datasketches/quantiles/DoublesMergeImpl.java   |  8 +--
 .../datasketches/quantiles/DoublesSketch.java      | 15 +++--
 .../quantiles/DoublesSketchSortedView.java         |  8 +++
 .../apache/datasketches/quantiles/DoublesUtil.java | 14 ++--
 .../quantiles/HeapCompactDoublesSketch.java        | 37 ++++++-----
 .../quantiles/HeapUpdateDoublesSketch.java         | 55 ++++++++--------
 .../datasketches/quantiles/ItemsMergeImpl.java     | 16 ++---
 .../apache/datasketches/quantiles/ItemsSketch.java | 74 ++++++++++++++--------
 .../quantiles/ItemsSketchSortedView.java           | 12 +++-
 .../apache/datasketches/quantiles/ItemsUtil.java   |  6 +-
 .../quantiles/UpdateDoublesSketch.java             | 12 ++--
 .../quantilescommon/DoublesSortedView.java         | 14 ++--
 .../quantilescommon/FloatsSortedView.java          | 14 ++--
 .../quantilescommon/GenericSortedView.java         | 12 ++--
 .../quantilescommon/QuantilesDoublesAPI.java       | 42 ++++++------
 .../quantilescommon/QuantilesFloatsAPI.java        | 46 ++++++--------
 .../quantilescommon/QuantilesGenericAPI.java       | 50 +++++++--------
 .../quantilescommon/QuantilesUtil.java             |  2 +
 .../datasketches/quantilescommon/SortedView.java   | 17 +++--
 .../org/apache/datasketches/req/BaseReqSketch.java |  4 +-
 .../org/apache/datasketches/req/ReqSketch.java     | 15 +++--
 .../datasketches/req/ReqSketchSortedView.java      | 10 ++-
 .../thetacommon/SetOperationCornerCases.java       |  1 -
 .../datasketches/tuple/SerializerDeserializer.java |  1 -
 .../java/org/apache/datasketches/tuple/Util.java   |  2 +-
 .../kll/KllDirectCompactDoublesSketchTest.java     |  5 +-
 .../kll/KllDirectCompactFloatsSketchTest.java      |  5 +-
 .../kll/KllDirectDoublesSketchTest.java            | 23 ++++---
 .../kll/KllDirectFloatsSketchTest.java             | 63 +++++++++---------
 .../datasketches/kll/KllDoublesSketchTest.java     | 28 ++++----
 .../kll/KllFloatsSketchIteratorTest.java           |  4 +-
 .../datasketches/kll/KllFloatsSketchTest.java      | 18 +++---
 .../datasketches/kll/KllMiscDirectDoublesTest.java |  5 +-
 .../datasketches/kll/KllMiscDirectFloatsTest.java  |  6 +-
 .../datasketches/kll/KllMiscDoublesTest.java       |  4 +-
 .../apache/datasketches/kll/KllMiscFloatsTest.java |  5 +-
 .../quantiles/DirectCompactDoublesSketchTest.java  | 17 ++---
 .../quantiles/DirectUpdateDoublesSketchTest.java   |  9 ++-
 .../datasketches/quantiles/DoublesSketchTest.java  | 12 ++--
 .../quantiles/HeapCompactDoublesSketchTest.java    | 16 ++---
 .../quantiles/HeapUpdateDoublesSketchTest.java     | 24 +++----
 .../datasketches/quantiles/ItemsSketchTest.java    | 28 ++++----
 .../datasketches/quantiles/ItemsUnionTest.java     | 41 ++++++------
 .../datasketches/quantiles/ReadOnlyMemoryTest.java |  4 +-
 .../datasketches/req/ReqSketchOtherTest.java       | 18 +++---
 .../org/apache/datasketches/req/ReqSketchTest.java | 13 ++--
 58 files changed, 512 insertions(+), 439 deletions(-)

diff --git a/src/main/java/org/apache/datasketches/hll/TgtHllType.java b/src/main/java/org/apache/datasketches/hll/TgtHllType.java
index 0c41ac15..4e2c5034 100644
--- a/src/main/java/org/apache/datasketches/hll/TgtHllType.java
+++ b/src/main/java/org/apache/datasketches/hll/TgtHllType.java
@@ -50,7 +50,6 @@ package org.apache.datasketches.hll;
  * </ul>
  * @author Lee Rhodes
  */
-@SuppressWarnings("javadoc")
 public enum TgtHllType { HLL_4, HLL_6, HLL_8;
 
   private static final TgtHllType values[] = values();
diff --git a/src/main/java/org/apache/datasketches/kll/KllDoublesHelper.java b/src/main/java/org/apache/datasketches/kll/KllDoublesHelper.java
index 5ba0361d..236b4c44 100644
--- a/src/main/java/org/apache/datasketches/kll/KllDoublesHelper.java
+++ b/src/main/java/org/apache/datasketches/kll/KllDoublesHelper.java
@@ -43,8 +43,8 @@ final class KllDoublesHelper {
     final int[] otherLevelsArr = other.getLevelsArray();
     final double[] otherDoubleItemsArr;
     //capture my min & max, minK
-    final double myMin = sketch.getMinDoubleItem();
-    final double myMax = sketch.getMaxDoubleItem();
+    final double myMin = sketch.isEmpty() ? Double.NaN : sketch.getMinDoubleItem();
+    final double myMax = sketch.isEmpty() ? Double.NaN : sketch.getMaxDoubleItem();
     final int myMinK = sketch.getMinK();
 
     //update this sketch with level0 items from the other sketch
diff --git a/src/main/java/org/apache/datasketches/kll/KllDoublesSketch.java b/src/main/java/org/apache/datasketches/kll/KllDoublesSketch.java
index 36b410ee..b9b6aa2f 100644
--- a/src/main/java/org/apache/datasketches/kll/KllDoublesSketch.java
+++ b/src/main/java/org/apache/datasketches/kll/KllDoublesSketch.java
@@ -26,6 +26,7 @@ import static org.apache.datasketches.kll.KllSketch.Error.MUST_NOT_BE_UPDATABLE_
 import static org.apache.datasketches.kll.KllSketch.Error.MUST_NOT_CALL;
 import static org.apache.datasketches.kll.KllSketch.Error.TGT_IS_READ_ONLY;
 import static org.apache.datasketches.kll.KllSketch.Error.kllSketchThrow;
+import static org.apache.datasketches.quantilescommon.QuantilesUtil.THROWS_EMPTY;
 
 import java.util.Objects;
 
@@ -167,28 +168,34 @@ public abstract class KllDoublesSketch extends KllSketch implements QuantilesDou
   }
 
   @Override
-  public double getMaxItem() { return getMaxDoubleItem(); }
+  public double getMaxItem() {
+    if (isEmpty()) { throw new IllegalArgumentException(THROWS_EMPTY); }
+    return getMaxDoubleItem();
+  }
 
   @Override
-  public double getMinItem() { return getMinDoubleItem(); }
+  public double getMinItem() {
+    if (isEmpty()) { throw new IllegalArgumentException(THROWS_EMPTY); }
+    return getMinDoubleItem();
+  }
 
   @Override
   public double[] getCDF(final double[] splitPoints, final QuantileSearchCriteria searchCrit) {
-    if (this.isEmpty()) { return null; }
+    if (isEmpty()) { throw new IllegalArgumentException(THROWS_EMPTY); }
     refreshSortedView();
     return kllDoublesSV.getCDF(splitPoints, searchCrit);
   }
 
   @Override
   public double[] getPMF(final double[] splitPoints, final QuantileSearchCriteria searchCrit) {
-    if (this.isEmpty()) { return null; }
+    if (isEmpty()) { throw new IllegalArgumentException(THROWS_EMPTY); }
     refreshSortedView();
     return kllDoublesSV.getPMF(splitPoints, searchCrit);
   }
 
   @Override
   public double getQuantile(final double rank, final QuantileSearchCriteria searchCrit) {
-    if (this.isEmpty()) { return Float.NaN; }
+    if (isEmpty()) { throw new IllegalArgumentException(THROWS_EMPTY); }
     refreshSortedView();
     return kllDoublesSV.getQuantile(rank, searchCrit);
   }
@@ -196,7 +203,7 @@ public abstract class KllDoublesSketch extends KllSketch implements QuantilesDou
   @Deprecated
   @Override
   public double[] getQuantiles(final double[] ranks, final QuantileSearchCriteria searchCrit) {
-    if (this.isEmpty()) { return null; }
+    if (isEmpty()) { throw new IllegalArgumentException(THROWS_EMPTY); }
     refreshSortedView();
     final int len = ranks.length;
     final double[] quantiles = new double[len];
@@ -209,7 +216,7 @@ public abstract class KllDoublesSketch extends KllSketch implements QuantilesDou
   @Deprecated
   @Override
   public double[] getQuantiles(final int numEvenlySpaced, final QuantileSearchCriteria searchCrit) {
-    if (isEmpty()) { return null; }
+    if (isEmpty()) { throw new IllegalArgumentException(THROWS_EMPTY); }
     return getQuantiles(org.apache.datasketches.quantilescommon.QuantilesUtil.evenlySpaced(0.0, 1.0, numEvenlySpaced),
         searchCrit);
   }
@@ -236,7 +243,7 @@ public abstract class KllDoublesSketch extends KllSketch implements QuantilesDou
 
   @Override
   public double getRank(final double quantile, final QuantileSearchCriteria searchCrit) {
-    if (this.isEmpty()) { return Double.NaN; }
+    if (isEmpty()) { throw new IllegalArgumentException(THROWS_EMPTY); }
     refreshSortedView();
     return kllDoublesSV.getRank(quantile, searchCrit);
   }
@@ -264,7 +271,7 @@ public abstract class KllDoublesSketch extends KllSketch implements QuantilesDou
   @Deprecated
   @Override
   public double[] getRanks(final double[] quantiles, final QuantileSearchCriteria searchCrit) {
-    if (this.isEmpty()) { return null; }
+    if (isEmpty()) { throw new IllegalArgumentException(THROWS_EMPTY); }
     refreshSortedView();
     final int len = quantiles.length;
     final double[] ranks = new double[len];
diff --git a/src/main/java/org/apache/datasketches/kll/KllDoublesSketchSortedView.java b/src/main/java/org/apache/datasketches/kll/KllDoublesSketchSortedView.java
index 73e22760..9276da29 100644
--- a/src/main/java/org/apache/datasketches/kll/KllDoublesSketchSortedView.java
+++ b/src/main/java/org/apache/datasketches/kll/KllDoublesSketchSortedView.java
@@ -20,6 +20,7 @@
 package org.apache.datasketches.kll;
 
 import static org.apache.datasketches.quantilescommon.QuantileSearchCriteria.INCLUSIVE;
+import static org.apache.datasketches.quantilescommon.QuantilesUtil.THROWS_EMPTY;
 
 import java.util.Arrays;
 
@@ -73,6 +74,7 @@ public final class KllDoublesSketchSortedView implements DoublesSortedView {
 
   @Override
   public double getQuantile(final double rank, final QuantileSearchCriteria searchCrit) {
+    if (isEmpty()) { throw new IllegalArgumentException(THROWS_EMPTY); }
     QuantilesUtil.checkNormalizedRankBounds(rank);
     final int len = cumWeights.length;
     final long naturalRank = (searchCrit == INCLUSIVE)
@@ -87,6 +89,7 @@ public final class KllDoublesSketchSortedView implements DoublesSortedView {
 
   @Override
   public double getRank(final double quantile, final QuantileSearchCriteria searchCrit) {
+    if (isEmpty()) { throw new IllegalArgumentException(THROWS_EMPTY); }
     final int len = quantiles.length;
     final InequalitySearch crit = (searchCrit == INCLUSIVE) ? InequalitySearch.LE : InequalitySearch.LT;
     final int index = InequalitySearch.find(quantiles,  0, len - 1, quantile, crit);
@@ -106,6 +109,11 @@ public final class KllDoublesSketchSortedView implements DoublesSortedView {
     return quantiles.clone();
   }
 
+  @Override
+  public boolean isEmpty() {
+    return totalN == 0;
+  }
+
   @Override
   public KllDoublesSketchSortedViewIterator iterator() {
     return new KllDoublesSketchSortedViewIterator(quantiles, cumWeights);
diff --git a/src/main/java/org/apache/datasketches/kll/KllFloatsHelper.java b/src/main/java/org/apache/datasketches/kll/KllFloatsHelper.java
index 78ccb9da..321e1527 100644
--- a/src/main/java/org/apache/datasketches/kll/KllFloatsHelper.java
+++ b/src/main/java/org/apache/datasketches/kll/KllFloatsHelper.java
@@ -43,8 +43,8 @@ final class KllFloatsHelper {
     final int[] otherLevelsArr = other.getLevelsArray();
     final float[] otherFloatItemsArr;
     //capture my min & max, minK
-    final float myMin = sketch.getMinFloatItem();
-    final float myMax = sketch.getMaxFloatItem();
+    final float myMin = sketch.isEmpty() ? Float.NaN : sketch.getMinFloatItem();
+    final float myMax = sketch.isEmpty() ? Float.NaN : sketch.getMaxFloatItem();
     final int myMinK = sketch.getMinK();
 
     //update this sketch with level0 items from the other sketch
diff --git a/src/main/java/org/apache/datasketches/kll/KllFloatsSketch.java b/src/main/java/org/apache/datasketches/kll/KllFloatsSketch.java
index 282d7026..4a8d923f 100644
--- a/src/main/java/org/apache/datasketches/kll/KllFloatsSketch.java
+++ b/src/main/java/org/apache/datasketches/kll/KllFloatsSketch.java
@@ -26,6 +26,7 @@ import static org.apache.datasketches.kll.KllSketch.Error.MUST_NOT_BE_UPDATABLE_
 import static org.apache.datasketches.kll.KllSketch.Error.MUST_NOT_CALL;
 import static org.apache.datasketches.kll.KllSketch.Error.TGT_IS_READ_ONLY;
 import static org.apache.datasketches.kll.KllSketch.Error.kllSketchThrow;
+import static org.apache.datasketches.quantilescommon.QuantilesUtil.THROWS_EMPTY;
 
 import java.util.Objects;
 
@@ -167,28 +168,34 @@ public abstract class KllFloatsSketch extends KllSketch implements QuantilesFloa
   }
 
   @Override
-  public float getMaxItem() { return getMaxFloatItem(); }
+  public float getMaxItem() {
+    if (isEmpty()) { throw new IllegalArgumentException(THROWS_EMPTY); }
+    return getMaxFloatItem();
+  }
 
   @Override
-  public float getMinItem() { return getMinFloatItem(); }
+  public float getMinItem() {
+    if (isEmpty()) { throw new IllegalArgumentException(THROWS_EMPTY); }
+    return getMinFloatItem();
+  }
 
   @Override
   public double[] getCDF(final float[] splitPoints, final QuantileSearchCriteria searchCrit) {
-    if (this.isEmpty()) { return null; }
+    if (isEmpty()) { throw new IllegalArgumentException(THROWS_EMPTY); }
     refreshSortedView();
     return kllFloatsSV.getCDF(splitPoints, searchCrit);
   }
 
   @Override
   public double[] getPMF(final float[] splitPoints, final QuantileSearchCriteria searchCrit) {
-    if (this.isEmpty()) { return null; }
+    if (isEmpty()) { throw new IllegalArgumentException(THROWS_EMPTY); }
     refreshSortedView();
     return kllFloatsSV.getPMF(splitPoints, searchCrit);
   }
 
   @Override
   public float getQuantile(final double rank, final QuantileSearchCriteria searchCrit) {
-    if (this.isEmpty()) { return Float.NaN; }
+    if (isEmpty()) { throw new IllegalArgumentException(THROWS_EMPTY); }
     refreshSortedView();
     return kllFloatsSV.getQuantile(rank, searchCrit);
   }
@@ -196,7 +203,7 @@ public abstract class KllFloatsSketch extends KllSketch implements QuantilesFloa
   @Deprecated
   @Override
   public float[] getQuantiles(final double[] ranks, final QuantileSearchCriteria searchCrit) {
-    if (this.isEmpty()) { return null; }
+    if (isEmpty()) { throw new IllegalArgumentException(THROWS_EMPTY); }
     refreshSortedView();
     final int len = ranks.length;
     final float[] quantiles = new float[len];
@@ -209,7 +216,7 @@ public abstract class KllFloatsSketch extends KllSketch implements QuantilesFloa
   @Deprecated
   @Override
   public float[] getQuantiles(final int numEvenlySpaced, final QuantileSearchCriteria searchCrit) {
-    if (isEmpty()) { return null; }
+    if (isEmpty()) { throw new IllegalArgumentException(THROWS_EMPTY); }
     return getQuantiles(org.apache.datasketches.quantilescommon.QuantilesUtil.evenlySpaced(0.0, 1.0, numEvenlySpaced),
         searchCrit);
   }
@@ -236,7 +243,7 @@ public abstract class KllFloatsSketch extends KllSketch implements QuantilesFloa
 
   @Override
   public double getRank(final float quantile, final QuantileSearchCriteria searchCrit) {
-    if (this.isEmpty()) { return Double.NaN; }
+    if (isEmpty()) { throw new IllegalArgumentException(THROWS_EMPTY); }
     refreshSortedView();
     return kllFloatsSV.getRank(quantile, searchCrit);
   }
@@ -264,7 +271,7 @@ public abstract class KllFloatsSketch extends KllSketch implements QuantilesFloa
   @Deprecated
   @Override
   public double[] getRanks(final float[] quantiles, final QuantileSearchCriteria searchCrit) {
-    if (this.isEmpty()) { return null; }
+    if (isEmpty()) { throw new IllegalArgumentException(THROWS_EMPTY); }
     refreshSortedView();
     final int len = quantiles.length;
     final double[] ranks = new double[len];
diff --git a/src/main/java/org/apache/datasketches/kll/KllFloatsSketchSortedView.java b/src/main/java/org/apache/datasketches/kll/KllFloatsSketchSortedView.java
index 46d74ddc..5a7f0e8f 100644
--- a/src/main/java/org/apache/datasketches/kll/KllFloatsSketchSortedView.java
+++ b/src/main/java/org/apache/datasketches/kll/KllFloatsSketchSortedView.java
@@ -20,6 +20,7 @@
 package org.apache.datasketches.kll;
 
 import static org.apache.datasketches.quantilescommon.QuantileSearchCriteria.INCLUSIVE;
+import static org.apache.datasketches.quantilescommon.QuantilesUtil.THROWS_EMPTY;
 
 import java.util.Arrays;
 
@@ -73,6 +74,7 @@ public final class KllFloatsSketchSortedView implements FloatsSortedView {
 
   @Override
   public float getQuantile(final double rank, final QuantileSearchCriteria searchCrit) {
+    if (isEmpty()) { throw new IllegalArgumentException(THROWS_EMPTY); }
     QuantilesUtil.checkNormalizedRankBounds(rank);
     final int len = cumWeights.length;
     final long naturalRank = (searchCrit == INCLUSIVE)
@@ -87,6 +89,7 @@ public final class KllFloatsSketchSortedView implements FloatsSortedView {
 
   @Override
   public double getRank(final float quantile, final QuantileSearchCriteria searchCrit) {
+    if (isEmpty()) { throw new IllegalArgumentException(THROWS_EMPTY); }
     final int len = quantiles.length;
     final InequalitySearch crit = (searchCrit == INCLUSIVE) ? InequalitySearch.LE : InequalitySearch.LT;
     final int index = InequalitySearch.find(quantiles,  0, len - 1, quantile, crit);
@@ -106,6 +109,11 @@ public final class KllFloatsSketchSortedView implements FloatsSortedView {
     return quantiles.clone();
   }
 
+  @Override
+  public boolean isEmpty() {
+    return totalN == 0;
+  }
+
   @Override
   public KllFloatsSketchSortedViewIterator iterator() {
     return new KllFloatsSketchSortedViewIterator(quantiles, cumWeights);
diff --git a/src/main/java/org/apache/datasketches/kll/KllSketch.java b/src/main/java/org/apache/datasketches/kll/KllSketch.java
index 4c870083..23e32d07 100644
--- a/src/main/java/org/apache/datasketches/kll/KllSketch.java
+++ b/src/main/java/org/apache/datasketches/kll/KllSketch.java
@@ -78,7 +78,6 @@ public abstract class KllSketch implements QuantilesAPI {
   /**
    * Used to define the variable type of the current instance of this class.
    */
-  @SuppressWarnings("javadoc")
   public enum SketchType { FLOATS_SKETCH, DOUBLES_SKETCH }
 
   enum Error {
diff --git a/src/main/java/org/apache/datasketches/quantiles/DirectCompactDoublesSketch.java b/src/main/java/org/apache/datasketches/quantiles/DirectCompactDoublesSketch.java
index 3dac63c4..b7a6b6f5 100644
--- a/src/main/java/org/apache/datasketches/quantiles/DirectCompactDoublesSketch.java
+++ b/src/main/java/org/apache/datasketches/quantiles/DirectCompactDoublesSketch.java
@@ -19,6 +19,9 @@
 
 package org.apache.datasketches.quantiles;
 
+import static org.apache.datasketches.quantiles.ClassicUtil.computeBaseBufferItems;
+import static org.apache.datasketches.quantiles.ClassicUtil.computeBitPattern;
+import static org.apache.datasketches.quantiles.ClassicUtil.computeRetainedItems;
 import static org.apache.datasketches.quantiles.PreambleUtil.COMBINED_BUFFER;
 import static org.apache.datasketches.quantiles.PreambleUtil.COMPACT_FLAG_MASK;
 import static org.apache.datasketches.quantiles.PreambleUtil.EMPTY_FLAG_MASK;
@@ -41,9 +44,7 @@ import static org.apache.datasketches.quantiles.PreambleUtil.insertMinDouble;
 import static org.apache.datasketches.quantiles.PreambleUtil.insertN;
 import static org.apache.datasketches.quantiles.PreambleUtil.insertPreLongs;
 import static org.apache.datasketches.quantiles.PreambleUtil.insertSerVer;
-import static org.apache.datasketches.quantiles.ClassicUtil.computeBaseBufferItems;
-import static org.apache.datasketches.quantiles.ClassicUtil.computeBitPattern;
-import static org.apache.datasketches.quantiles.ClassicUtil.computeRetainedItems;
+import static org.apache.datasketches.quantilescommon.QuantilesUtil.THROWS_EMPTY;
 
 import java.util.Arrays;
 
@@ -162,12 +163,14 @@ final class DirectCompactDoublesSketch extends CompactDoublesSketch {
 
   @Override
   public double getMaxItem() {
-    return isEmpty() ? Double.NaN : mem_.getDouble(MAX_DOUBLE);
+    if (isEmpty()) { throw new IllegalArgumentException(THROWS_EMPTY); }
+    return mem_.getDouble(MAX_DOUBLE);
   }
 
   @Override
   public double getMinItem() {
-    return isEmpty() ? Double.NaN : mem_.getDouble(MIN_DOUBLE);
+    if (isEmpty()) { throw new IllegalArgumentException(THROWS_EMPTY); }
+    return mem_.getDouble(MIN_DOUBLE);
   }
 
   @Override
diff --git a/src/main/java/org/apache/datasketches/quantiles/DirectUpdateDoublesSketch.java b/src/main/java/org/apache/datasketches/quantiles/DirectUpdateDoublesSketch.java
index 0c3d6b44..c388f936 100644
--- a/src/main/java/org/apache/datasketches/quantiles/DirectUpdateDoublesSketch.java
+++ b/src/main/java/org/apache/datasketches/quantiles/DirectUpdateDoublesSketch.java
@@ -150,11 +150,11 @@ final class DirectUpdateDoublesSketch extends DirectUpdateDoublesSketchR {
     final long newN = curN + 1;
 
     if (curN == 0) { //set min and max quantiles
-      putMaxQuantile(dataItem);
-      putMinQuantile(dataItem);
+      putMaxItem(dataItem);
+      putMinItem(dataItem);
     } else {
-      if (dataItem > getMaxItem()) { putMaxQuantile(dataItem); }
-      if (dataItem < getMinItem()) { putMinQuantile(dataItem); }
+      if (dataItem > getMaxItem()) { putMaxItem(dataItem); }
+      if (dataItem < getMinItem()) { putMinItem(dataItem); }
     }
 
     mem_.putDouble(COMBINED_BUFFER + ((long) curBBCount * Double.BYTES), dataItem); //put the item
@@ -207,13 +207,13 @@ final class DirectUpdateDoublesSketch extends DirectUpdateDoublesSketchR {
   //Puts
 
   @Override
-  void putMinQuantile(final double minQuantile) {
+  void putMinItem(final double minQuantile) {
     assert (mem_.getCapacity() >= COMBINED_BUFFER);
     mem_.putDouble(MIN_DOUBLE, minQuantile);
   }
 
   @Override
-  void putMaxQuantile(final double maxQuantile) {
+  void putMaxItem(final double maxQuantile) {
     assert (mem_.getCapacity() >= COMBINED_BUFFER);
     mem_.putDouble(MAX_DOUBLE, maxQuantile);
   }
diff --git a/src/main/java/org/apache/datasketches/quantiles/DirectUpdateDoublesSketchR.java b/src/main/java/org/apache/datasketches/quantiles/DirectUpdateDoublesSketchR.java
index 339bc58f..261905b8 100644
--- a/src/main/java/org/apache/datasketches/quantiles/DirectUpdateDoublesSketchR.java
+++ b/src/main/java/org/apache/datasketches/quantiles/DirectUpdateDoublesSketchR.java
@@ -33,6 +33,7 @@ import static org.apache.datasketches.quantiles.PreambleUtil.extractK;
 import static org.apache.datasketches.quantiles.PreambleUtil.extractN;
 import static org.apache.datasketches.quantiles.PreambleUtil.extractPreLongs;
 import static org.apache.datasketches.quantiles.PreambleUtil.extractSerVer;
+import static org.apache.datasketches.quantilescommon.QuantilesUtil.THROWS_EMPTY;
 
 import org.apache.datasketches.common.SketchesArgumentException;
 import org.apache.datasketches.common.SketchesReadOnlyException;
@@ -90,12 +91,14 @@ class DirectUpdateDoublesSketchR extends UpdateDoublesSketch {
 
   @Override
   public double getMaxItem() {
-    return isEmpty() ? Double.NaN : mem_.getDouble(MAX_DOUBLE);
+    if (isEmpty()) { throw new IllegalArgumentException(THROWS_EMPTY); }
+    return mem_.getDouble(MAX_DOUBLE);
   }
 
   @Override
   public double getMinItem() {
-    return isEmpty() ? Double.NaN : mem_.getDouble(MIN_DOUBLE);
+    if (isEmpty()) { throw new IllegalArgumentException(THROWS_EMPTY); }
+    return mem_.getDouble(MIN_DOUBLE);
   }
 
   @Override
@@ -172,12 +175,12 @@ class DirectUpdateDoublesSketchR extends UpdateDoublesSketch {
   //Puts
 
   @Override
-  void putMinQuantile(final double minQuantile) {
+  void putMinItem(final double minQuantile) {
     throw new SketchesReadOnlyException("Call to putMinQuantile() on read-only buffer");
   }
 
   @Override
-  void putMaxQuantile(final double maxQuantile) {
+  void putMaxItem(final double maxQuantile) {
     throw new SketchesReadOnlyException("Call to putMaxQuantile() on read-only buffer");
   }
 
diff --git a/src/main/java/org/apache/datasketches/quantiles/DoublesByteArrayImpl.java b/src/main/java/org/apache/datasketches/quantiles/DoublesByteArrayImpl.java
index 9dee6999..0ba857d6 100644
--- a/src/main/java/org/apache/datasketches/quantiles/DoublesByteArrayImpl.java
+++ b/src/main/java/org/apache/datasketches/quantiles/DoublesByteArrayImpl.java
@@ -98,8 +98,8 @@ final class DoublesByteArrayImpl {
     if (sketch.isEmpty()) { return outByteArr; }
 
     insertN(memOut, n);
-    insertMinDouble(memOut, sketch.getMinItem());
-    insertMaxDouble(memOut, sketch.getMaxItem());
+    insertMinDouble(memOut, sketch.isEmpty() ? Double.NaN : sketch.getMinItem());
+    insertMaxDouble(memOut, sketch.isEmpty() ? Double.NaN : sketch.getMaxItem());
 
     long memOffsetBytes = prePlusExtraBytes;
 
diff --git a/src/main/java/org/apache/datasketches/quantiles/DoublesMergeImpl.java b/src/main/java/org/apache/datasketches/quantiles/DoublesMergeImpl.java
index 4bbbe82c..9e207fc0 100644
--- a/src/main/java/org/apache/datasketches/quantiles/DoublesMergeImpl.java
+++ b/src/main/java/org/apache/datasketches/quantiles/DoublesMergeImpl.java
@@ -126,8 +126,8 @@ final class DoublesMergeImpl {
     double tgtMin = tgt.getMinItem();
     tgtMin = Double.isNaN(tgtMin) ? Double.POSITIVE_INFINITY : tgtMin;
 
-    tgt.putMaxQuantile(Math.max(srcMax, tgtMax));
-    tgt.putMinQuantile(Math.min(srcMin, tgtMin));
+    tgt.putMaxItem(Math.max(srcMax, tgtMax));
+    tgt.putMinItem(Math.min(srcMin, tgtMin));
   }
 
   /**
@@ -216,8 +216,8 @@ final class DoublesMergeImpl {
     double tgtMin = tgt.getMinItem();
     tgtMin = Double.isNaN(tgtMin) ? Double.POSITIVE_INFINITY : tgtMin;
 
-    if (srcMax > tgtMax) { tgt.putMaxQuantile(srcMax); }
-    if (srcMin < tgtMin) { tgt.putMinQuantile(srcMin); }
+    if (srcMax > tgtMax) { tgt.putMaxItem(srcMax); }
+    if (srcMin < tgtMin) { tgt.putMinItem(srcMin); }
   }
 
   private static void justZipWithStride(
diff --git a/src/main/java/org/apache/datasketches/quantiles/DoublesSketch.java b/src/main/java/org/apache/datasketches/quantiles/DoublesSketch.java
index e3698b46..86ab9464 100644
--- a/src/main/java/org/apache/datasketches/quantiles/DoublesSketch.java
+++ b/src/main/java/org/apache/datasketches/quantiles/DoublesSketch.java
@@ -23,6 +23,7 @@ import static java.lang.Math.max;
 import static java.lang.Math.min;
 import static org.apache.datasketches.common.Util.ceilingIntPowerOf2;
 import static org.apache.datasketches.quantiles.ClassicUtil.checkIsCompactMemory;
+import static org.apache.datasketches.quantilescommon.QuantilesUtil.THROWS_EMPTY;
 
 import java.util.Random;
 
@@ -165,21 +166,21 @@ public abstract class DoublesSketch implements QuantilesDoublesAPI {
 
   @Override
   public double[] getCDF(final double[] splitPoints, final QuantileSearchCriteria searchCrit) {
-    if (this.isEmpty()) { return null; }
+	if (isEmpty()) { throw new IllegalArgumentException(THROWS_EMPTY); }
     refreshSortedView();
     return classicQdsSV.getCDF(splitPoints, searchCrit);
   }
 
   @Override
   public double[] getPMF(final double[] splitPoints, final QuantileSearchCriteria searchCrit) {
-    if (this.isEmpty()) { return null; }
+	if (isEmpty()) { throw new IllegalArgumentException(THROWS_EMPTY); }
     refreshSortedView();
     return classicQdsSV.getPMF(splitPoints, searchCrit);
   }
 
   @Override
   public double getQuantile(final double rank, final QuantileSearchCriteria searchCrit) {
-    if (isEmpty()) { return Double.NaN; }
+	if (isEmpty()) { throw new IllegalArgumentException(THROWS_EMPTY); }
     refreshSortedView();
     return classicQdsSV.getQuantile(rank, searchCrit);
   }
@@ -187,7 +188,7 @@ public abstract class DoublesSketch implements QuantilesDoublesAPI {
   @Deprecated
   @Override
   public double[] getQuantiles(final double[] ranks, final QuantileSearchCriteria searchCrit) {
-    if (isEmpty()) { return null; }
+    if (isEmpty()) { throw new IllegalArgumentException(THROWS_EMPTY); }
     refreshSortedView();
     final int len = ranks.length;
     final double[] quantiles = new double[len];
@@ -200,7 +201,7 @@ public abstract class DoublesSketch implements QuantilesDoublesAPI {
   @Deprecated
   @Override
   public double[] getQuantiles(final int numEvenlySpaced, final QuantileSearchCriteria searchCrit) {
-    if (isEmpty()) { return null; }
+    if (isEmpty()) { throw new IllegalArgumentException(THROWS_EMPTY); }
     return getQuantiles(org.apache.datasketches.quantilescommon.QuantilesUtil.evenlySpaced(0.0, 1.0, numEvenlySpaced),
         searchCrit);
   }
@@ -227,7 +228,7 @@ public abstract class DoublesSketch implements QuantilesDoublesAPI {
 
   @Override
   public double getRank(final double quantile, final QuantileSearchCriteria searchCrit) {
-    if (isEmpty()) { return Double.NaN; }
+    if (isEmpty()) { throw new IllegalArgumentException(THROWS_EMPTY); }
     refreshSortedView();
     return classicQdsSV.getRank(quantile, searchCrit);
   }
@@ -255,7 +256,7 @@ public abstract class DoublesSketch implements QuantilesDoublesAPI {
   @Deprecated
   @Override
   public double[] getRanks(final double[] quantiles, final QuantileSearchCriteria searchCrit) {
-    if (this.isEmpty()) { return null; }
+    if (isEmpty()) { throw new IllegalArgumentException(THROWS_EMPTY); }
     refreshSortedView();
     final int len = quantiles.length;
     final double[] ranks = new double[len];
diff --git a/src/main/java/org/apache/datasketches/quantiles/DoublesSketchSortedView.java b/src/main/java/org/apache/datasketches/quantiles/DoublesSketchSortedView.java
index d59d51b1..543b4fe7 100644
--- a/src/main/java/org/apache/datasketches/quantiles/DoublesSketchSortedView.java
+++ b/src/main/java/org/apache/datasketches/quantiles/DoublesSketchSortedView.java
@@ -22,6 +22,7 @@ package org.apache.datasketches.quantiles;
 import static java.lang.System.arraycopy;
 import static org.apache.datasketches.quantiles.DoublesSketchAccessor.BB_LVL_IDX;
 import static org.apache.datasketches.quantilescommon.QuantileSearchCriteria.INCLUSIVE;
+import static org.apache.datasketches.quantilescommon.QuantilesUtil.THROWS_EMPTY;
 
 import java.util.Arrays;
 
@@ -79,6 +80,7 @@ public final class DoublesSketchSortedView implements DoublesSortedView {
 
   @Override
   public double getQuantile(final double rank, final QuantileSearchCriteria searchCrit) {
+    if (isEmpty()) { throw new IllegalArgumentException(THROWS_EMPTY); }
     QuantilesUtil.checkNormalizedRankBounds(rank);
     final int len = cumWeights.length;
     final long naturalRank = (searchCrit == INCLUSIVE)
@@ -93,6 +95,7 @@ public final class DoublesSketchSortedView implements DoublesSortedView {
 
   @Override
   public double getRank(final double quantile, final QuantileSearchCriteria searchCrit) {
+    if (isEmpty()) { throw new IllegalArgumentException(THROWS_EMPTY); }
     final int len = quantiles.length;
     final InequalitySearch crit = (searchCrit == INCLUSIVE) ? InequalitySearch.LE : InequalitySearch.LT;
     final int index = InequalitySearch.find(quantiles,  0, len - 1, quantile, crit);
@@ -112,6 +115,11 @@ public final class DoublesSketchSortedView implements DoublesSortedView {
     return quantiles.clone();
   }
 
+  @Override
+  public boolean isEmpty() {
+    return totalN == 0;
+  }
+
   @Override
   public DoublesSketchSortedViewIterator iterator() {
     return new DoublesSketchSortedViewIterator(quantiles, cumWeights);
diff --git a/src/main/java/org/apache/datasketches/quantiles/DoublesUtil.java b/src/main/java/org/apache/datasketches/quantiles/DoublesUtil.java
index 5f5d11e9..3814eb11 100644
--- a/src/main/java/org/apache/datasketches/quantiles/DoublesUtil.java
+++ b/src/main/java/org/apache/datasketches/quantiles/DoublesUtil.java
@@ -48,8 +48,8 @@ final class DoublesUtil {
     final HeapUpdateDoublesSketch qsCopy;
     qsCopy = HeapUpdateDoublesSketch.newInstance(sketch.getK());
     qsCopy.putN(sketch.getN());
-    qsCopy.putMinQuantile(sketch.getMinItem());
-    qsCopy.putMaxQuantile(sketch.getMaxItem());
+    qsCopy.putMinItem(sketch.isEmpty() ? Double.NaN : sketch.getMinItem());
+    qsCopy.putMaxItem(sketch.isEmpty() ? Double.NaN : sketch.getMaxItem());
     qsCopy.putBaseBufferCount(sketch.getBaseBufferCount());
     qsCopy.putBitPattern(sketch.getBitPattern());
 
@@ -131,6 +131,8 @@ final class DoublesUtil {
     final double eps =  ClassicUtil.getNormalizedRankError(k, false);
     final String epsPctStr = String.format("%.3f%%", eps * 100.0);
     final String memCap = sk.hasMemory() ? Long.toString(sk.getMemory().getCapacity()) : "";
+    final double minItem = sk.isEmpty() ? Double.NaN : sk.getMinItem();
+    final double maxItem = sk.isEmpty() ? Double.NaN : sk.getMaxItem();
 
     sb.append(ClassicUtil.LS).append("### Quantiles ").append(thisSimpleName).append(" SUMMARY: ")
       .append(LS);
@@ -151,10 +153,10 @@ final class DoublesUtil {
     sb.append("   Updatable Storage Bytes      : ").append(updtBytesStr).append(LS);
     sb.append("   Normalized Rank Error        : ").append(epsPctStr).append(LS);
     sb.append("   Normalized Rank Error (PMF)  : ").append(epsPmfPctStr).append(LS);
-    sb.append("   Min Quantile                 : ")
-      .append(String.format("%12.6e", sk.getMinItem())).append(LS);
-    sb.append("   Max Quantile                 : ")
-      .append(String.format("%12.6e", sk.getMaxItem())).append(LS);
+    sb.append("   Min Item                     : ")
+      .append(String.format("%12.6e", minItem)).append(LS);
+    sb.append("   Max Item                     : ")
+      .append(String.format("%12.6e", maxItem)).append(LS);
     sb.append("### END SKETCH SUMMARY").append(LS);
     return sb.toString();
   }
diff --git a/src/main/java/org/apache/datasketches/quantiles/HeapCompactDoublesSketch.java b/src/main/java/org/apache/datasketches/quantiles/HeapCompactDoublesSketch.java
index b65cffc9..f5b36843 100644
--- a/src/main/java/org/apache/datasketches/quantiles/HeapCompactDoublesSketch.java
+++ b/src/main/java/org/apache/datasketches/quantiles/HeapCompactDoublesSketch.java
@@ -19,6 +19,9 @@
 
 package org.apache.datasketches.quantiles;
 
+import static org.apache.datasketches.quantiles.ClassicUtil.computeBaseBufferItems;
+import static org.apache.datasketches.quantiles.ClassicUtil.computeBitPattern;
+import static org.apache.datasketches.quantiles.ClassicUtil.computeRetainedItems;
 import static org.apache.datasketches.quantiles.PreambleUtil.COMPACT_FLAG_MASK;
 import static org.apache.datasketches.quantiles.PreambleUtil.EMPTY_FLAG_MASK;
 import static org.apache.datasketches.quantiles.PreambleUtil.MAX_DOUBLE;
@@ -30,9 +33,7 @@ import static org.apache.datasketches.quantiles.PreambleUtil.extractK;
 import static org.apache.datasketches.quantiles.PreambleUtil.extractN;
 import static org.apache.datasketches.quantiles.PreambleUtil.extractPreLongs;
 import static org.apache.datasketches.quantiles.PreambleUtil.extractSerVer;
-import static org.apache.datasketches.quantiles.ClassicUtil.computeBaseBufferItems;
-import static org.apache.datasketches.quantiles.ClassicUtil.computeBitPattern;
-import static org.apache.datasketches.quantiles.ClassicUtil.computeRetainedItems;
+import static org.apache.datasketches.quantilescommon.QuantilesUtil.THROWS_EMPTY;
 
 import java.util.Arrays;
 
@@ -50,14 +51,14 @@ final class HeapCompactDoublesSketch extends CompactDoublesSketch {
   static final int MIN_HEAP_DOUBLES_SER_VER = 1;
 
   /**
-   * The smallest quantile ever seen in the stream.
+   * The smallest item ever seen in the stream.
    */
-  private double minQuantile_;
+  private double minItem_;
 
   /**
-   * The largest quantile ever seen in the stream.
+   * The largest item ever seen in the stream.
    */
-  private double maxQuantile_;
+  private double maxItem_;
 
   /**
    * The total count of items seen.
@@ -65,7 +66,7 @@ final class HeapCompactDoublesSketch extends CompactDoublesSketch {
   private long n_;
 
   /**
-   * Number of quantiles currently in base buffer.
+   * Number of item currently in base buffer.
    *
    * <p>Count = N % (2*K)
    */
@@ -83,7 +84,7 @@ final class HeapCompactDoublesSketch extends CompactDoublesSketch {
    * A level is of size K and is either full and sorted.
    * Whether a level buffer is present is indicated by the bitPattern_.
    * The base buffer is sorted and has max length 2*K but uses only baseBufferCount_ items.
-   * The base buffer precedes the level buffers. This buffer does not include the min, max quantiles.
+   * The base buffer precedes the level buffers. This buffer does not include the min, max items.
    *
    * <p>The levels arrays require quite a bit of explanation, which we defer until later.</p>
    */
@@ -110,8 +111,8 @@ final class HeapCompactDoublesSketch extends CompactDoublesSketch {
     hcds.bitPattern_ = computeBitPattern(k, n);
     assert hcds.bitPattern_ == sketch.getBitPattern();
 
-    hcds.minQuantile_ = sketch.getMinItem();
-    hcds.maxQuantile_ = sketch.getMaxItem();
+    hcds.minItem_ = sketch.isEmpty() ? Double.NaN : sketch.getMinItem();
+    hcds.maxItem_ = sketch.isEmpty() ? Double.NaN : sketch.getMaxItem();
     hcds.baseBufferCount_ = computeBaseBufferItems(k, n);
     assert hcds.baseBufferCount_ == sketch.getBaseBufferCount();
 
@@ -181,8 +182,8 @@ final class HeapCompactDoublesSketch extends CompactDoublesSketch {
       hds.combinedBuffer_ = null;
       hds.baseBufferCount_ = 0;
       hds.bitPattern_ = 0;
-      hds.minQuantile_ = Double.NaN;
-      hds.maxQuantile_ = Double.NaN;
+      hds.minItem_ = Double.NaN;
+      hds.maxItem_ = Double.NaN;
       return hds;
     }
 
@@ -196,8 +197,8 @@ final class HeapCompactDoublesSketch extends CompactDoublesSketch {
     hds.n_ = n;
     hds.baseBufferCount_ = computeBaseBufferItems(k, n);
     hds.bitPattern_ = computeBitPattern(k, n);
-    hds.minQuantile_ = srcMem.getDouble(MIN_DOUBLE);
-    hds.maxQuantile_ = srcMem.getDouble(MAX_DOUBLE);
+    hds.minItem_ = srcMem.getDouble(MIN_DOUBLE);
+    hds.maxItem_ = srcMem.getDouble(MAX_DOUBLE);
 
     final int totItems = ClassicUtil.computeRetainedItems(k, n);
     hds.srcMemoryToCombinedBuffer(srcMem, serVer, srcIsCompact, totItems);
@@ -222,12 +223,14 @@ final class HeapCompactDoublesSketch extends CompactDoublesSketch {
 
   @Override
   public double getMinItem() {
-    return minQuantile_;
+    if (isEmpty()) { throw new IllegalArgumentException(THROWS_EMPTY); }
+    return minItem_;
   }
 
   @Override
   public double getMaxItem() {
-    return maxQuantile_;
+    if (isEmpty()) { throw new IllegalArgumentException(THROWS_EMPTY); }
+    return maxItem_;
   }
 
   /**
diff --git a/src/main/java/org/apache/datasketches/quantiles/HeapUpdateDoublesSketch.java b/src/main/java/org/apache/datasketches/quantiles/HeapUpdateDoublesSketch.java
index 307459de..4a8d0075 100644
--- a/src/main/java/org/apache/datasketches/quantiles/HeapUpdateDoublesSketch.java
+++ b/src/main/java/org/apache/datasketches/quantiles/HeapUpdateDoublesSketch.java
@@ -19,6 +19,10 @@
 
 package org.apache.datasketches.quantiles;
 
+import static org.apache.datasketches.quantiles.ClassicUtil.computeBaseBufferItems;
+import static org.apache.datasketches.quantiles.ClassicUtil.computeBitPattern;
+import static org.apache.datasketches.quantiles.ClassicUtil.computeCombinedBufferItemCapacity;
+import static org.apache.datasketches.quantiles.ClassicUtil.computeRetainedItems;
 import static org.apache.datasketches.quantiles.PreambleUtil.COMPACT_FLAG_MASK;
 import static org.apache.datasketches.quantiles.PreambleUtil.EMPTY_FLAG_MASK;
 import static org.apache.datasketches.quantiles.PreambleUtil.MAX_DOUBLE;
@@ -29,10 +33,7 @@ import static org.apache.datasketches.quantiles.PreambleUtil.extractK;
 import static org.apache.datasketches.quantiles.PreambleUtil.extractN;
 import static org.apache.datasketches.quantiles.PreambleUtil.extractPreLongs;
 import static org.apache.datasketches.quantiles.PreambleUtil.extractSerVer;
-import static org.apache.datasketches.quantiles.ClassicUtil.computeBaseBufferItems;
-import static org.apache.datasketches.quantiles.ClassicUtil.computeBitPattern;
-import static org.apache.datasketches.quantiles.ClassicUtil.computeCombinedBufferItemCapacity;
-import static org.apache.datasketches.quantiles.ClassicUtil.computeRetainedItems;
+import static org.apache.datasketches.quantilescommon.QuantilesUtil.THROWS_EMPTY;
 
 import java.util.Arrays;
 
@@ -51,14 +52,14 @@ final class HeapUpdateDoublesSketch extends UpdateDoublesSketch {
   static final int MIN_HEAP_DOUBLES_SER_VER = 1;
 
   /**
-   * The smallest quantile ever seen in the stream.
+   * The smallest item ever seen in the stream.
    */
-  private double minQuantile_;
+  private double minItem_;
 
   /**
-   * The largest quantile ever seen in the stream.
+   * The largest item ever seen in the stream.
    */
-  private double maxQuantile_;
+  private double maxItem_;
 
   /**
    * The total count of items seen.
@@ -66,7 +67,7 @@ final class HeapUpdateDoublesSketch extends UpdateDoublesSketch {
   private long n_;
 
   /**
-   * Number of quantiles currently in base buffer.
+   * Number of items currently in base buffer.
    *
    * <p>Count = N % (2*K)</p>
    */
@@ -85,7 +86,7 @@ final class HeapUpdateDoublesSketch extends UpdateDoublesSketch {
    * A level is of size K and is either full and sorted, or not used. A "not used" buffer may have
    * garbage. Whether a level buffer used or not is indicated by the bitPattern_.
    * The base buffer has length 2*K but might not be full and isn't necessarily sorted.
-   * The base buffer precedes the level buffers. This buffer does not include the min, max quantiles.
+   * The base buffer precedes the level buffers. This buffer does not include the min, max items.
    *
    * <p>The levels arrays require quite a bit of explanation, which we defer until later.</p>
    */
@@ -110,8 +111,8 @@ final class HeapUpdateDoublesSketch extends UpdateDoublesSketch {
     hqs.combinedBuffer_ = new double[baseBufAlloc];
     hqs.baseBufferCount_ = 0;
     hqs.bitPattern_ = 0;
-    hqs.minQuantile_ = Double.NaN;
-    hqs.maxQuantile_ = Double.NaN;
+    hqs.minItem_ = Double.NaN;
+    hqs.maxItem_ = Double.NaN;
     return hqs;
   }
 
@@ -164,12 +165,14 @@ final class HeapUpdateDoublesSketch extends UpdateDoublesSketch {
 
   @Override
   public double getMaxItem() {
-    return maxQuantile_;
+    if (isEmpty()) { throw new IllegalArgumentException(THROWS_EMPTY); }
+    return maxItem_;
   }
 
   @Override
   public double getMinItem() {
-    return minQuantile_;
+    if (isEmpty()) { throw new IllegalArgumentException(THROWS_EMPTY); }
+    return minItem_;
   }
 
   @Override
@@ -199,8 +202,8 @@ final class HeapUpdateDoublesSketch extends UpdateDoublesSketch {
     combinedBuffer_ = new double[combinedBufferItemCapacity];
     baseBufferCount_ = 0;
     bitPattern_ = 0;
-    minQuantile_ = Double.NaN;
-    maxQuantile_ = Double.NaN;
+    minItem_ = Double.NaN;
+    maxItem_ = Double.NaN;
   }
 
   @Override
@@ -208,11 +211,11 @@ final class HeapUpdateDoublesSketch extends UpdateDoublesSketch {
     if (Double.isNaN(dataItem)) { return; }
 
     if (n_ == 0) {
-      putMaxQuantile(dataItem);
-      putMinQuantile(dataItem);
+      putMaxItem(dataItem);
+      putMinItem(dataItem);
     } else {
-      if (dataItem > getMaxItem()) { putMaxQuantile(dataItem); }
-      if (dataItem < getMinItem()) { putMinQuantile(dataItem); }
+      if (dataItem > getMaxItem()) { putMaxItem(dataItem); }
+      if (dataItem < getMinItem()) { putMinItem(dataItem); }
     }
 
     //don't increment n_ and baseBufferCount_ yet
@@ -284,8 +287,8 @@ final class HeapUpdateDoublesSketch extends UpdateDoublesSketch {
     final long n = getN();
     final double[] combinedBuffer = new double[combBufCap]; //always non-compact
     //Load min, max
-    putMinQuantile(srcMem.getDouble(MIN_DOUBLE));
-    putMaxQuantile(srcMem.getDouble(MAX_DOUBLE));
+    putMinItem(srcMem.getDouble(MIN_DOUBLE));
+    putMaxItem(srcMem.getDouble(MAX_DOUBLE));
 
     if (srcIsCompact) {
       //Load base buffer
@@ -345,13 +348,13 @@ final class HeapUpdateDoublesSketch extends UpdateDoublesSketch {
   //Puts
 
   @Override
-  void putMinQuantile(final double minQuantile) {
-    minQuantile_ = minQuantile;
+  void putMinItem(final double minItem) {
+    minItem_ = minItem;
   }
 
   @Override
-  void putMaxQuantile(final double maxQuantile) {
-    maxQuantile_ = maxQuantile;
+  void putMaxItem(final double maxItem) {
+    maxItem_ = maxItem;
   }
 
   @Override
diff --git a/src/main/java/org/apache/datasketches/quantiles/ItemsMergeImpl.java b/src/main/java/org/apache/datasketches/quantiles/ItemsMergeImpl.java
index 14074e63..c6af57d2 100644
--- a/src/main/java/org/apache/datasketches/quantiles/ItemsMergeImpl.java
+++ b/src/main/java/org/apache/datasketches/quantiles/ItemsMergeImpl.java
@@ -104,10 +104,10 @@ final class ItemsMergeImpl {
 
     assert (tgt.getN() / (2L * tgtK)) == tgt.getBitPattern(); // internal consistency check
 
-    final T srcMax = src.getMaxItem();
-    final T srcMin = src.getMinItem();
-    final T tgtMax = tgt.getMaxItem();
-    final T tgtMin = tgt.getMinItem();
+    final T srcMax = src.isEmpty() ? null : src.getMaxItem();
+    final T srcMin = src.isEmpty() ? null : src.getMinItem();
+    final T tgtMax = tgt.isEmpty() ? null : tgt.getMaxItem();
+    final T tgtMin = tgt.isEmpty() ? null : tgt.getMinItem();
 
     if ((srcMax != null) && (tgtMax != null)) {
       tgt.maxItem_ = (src.getComparator().compare(srcMax, tgtMax) > 0) ? srcMax : tgtMax;
@@ -183,10 +183,10 @@ final class ItemsMergeImpl {
 
     assert (tgt.getN() / (2L * targetK)) == tgt.getBitPattern(); // internal consistency check
 
-    final T srcMax = src.getMaxItem();
-    final T srcMin = src.getMinItem();
-    final T tgtMax = tgt.getMaxItem();
-    final T tgtMin = tgt.getMinItem();
+    final T srcMax = src.isEmpty() ? null : src.getMaxItem();
+    final T srcMin = src.isEmpty() ? null : src.getMinItem();
+    final T tgtMax = tgt.isEmpty() ? null : tgt.getMaxItem();
+    final T tgtMin = tgt.isEmpty() ? null : tgt.getMinItem();
 
     if ((srcMax != null) && (tgtMax != null)) {
       tgt.maxItem_ = (src.getComparator().compare(srcMax, tgtMax) > 0) ? srcMax : tgtMax;
diff --git a/src/main/java/org/apache/datasketches/quantiles/ItemsSketch.java b/src/main/java/org/apache/datasketches/quantiles/ItemsSketch.java
index 7f5bcc04..eeeb7967 100644
--- a/src/main/java/org/apache/datasketches/quantiles/ItemsSketch.java
+++ b/src/main/java/org/apache/datasketches/quantiles/ItemsSketch.java
@@ -21,6 +21,8 @@ package org.apache.datasketches.quantiles;
 
 import static java.lang.Math.max;
 import static java.lang.Math.min;
+import static org.apache.datasketches.quantiles.ClassicUtil.computeBaseBufferItems;
+import static org.apache.datasketches.quantiles.ClassicUtil.computeBitPattern;
 import static org.apache.datasketches.quantiles.PreambleUtil.COMPACT_FLAG_MASK;
 import static org.apache.datasketches.quantiles.PreambleUtil.extractFamilyID;
 import static org.apache.datasketches.quantiles.PreambleUtil.extractFlags;
@@ -28,9 +30,8 @@ import static org.apache.datasketches.quantiles.PreambleUtil.extractK;
 import static org.apache.datasketches.quantiles.PreambleUtil.extractN;
 import static org.apache.datasketches.quantiles.PreambleUtil.extractPreLongs;
 import static org.apache.datasketches.quantiles.PreambleUtil.extractSerVer;
-import static org.apache.datasketches.quantiles.ClassicUtil.computeBaseBufferItems;
-import static org.apache.datasketches.quantiles.ClassicUtil.computeBitPattern;
 import static org.apache.datasketches.quantilescommon.QuantileSearchCriteria.INCLUSIVE;
+import static org.apache.datasketches.quantilescommon.QuantilesUtil.THROWS_EMPTY;
 
 import java.lang.reflect.Array;
 import java.util.Arrays;
@@ -247,8 +248,8 @@ public final class ItemsSketch<T> implements QuantilesAPI {
   static <T> ItemsSketch<T> copy(final ItemsSketch<T> sketch) {
     final ItemsSketch<T> qsCopy = ItemsSketch.getInstance(sketch.clazz, sketch.k_, sketch.comparator_);
     qsCopy.n_ = sketch.n_;
-    qsCopy.minItem_ = sketch.getMinItem();
-    qsCopy.maxItem_ = sketch.getMaxItem();
+    qsCopy.minItem_ = sketch.isEmpty() ? null : sketch.getMinItem();
+    qsCopy.maxItem_ = sketch.isEmpty() ? null : sketch.getMaxItem();
     qsCopy.combinedBufferItemCapacity_ = sketch.getCombinedBufferAllocatedCount();
     qsCopy.baseBufferCount_ = sketch.getBaseBufferCount();
     qsCopy.bitPattern_ = sketch.getBitPattern();
@@ -261,6 +262,7 @@ public final class ItemsSketch<T> implements QuantilesAPI {
    * This is equivalent to {@link #getCDF(Object[], QuantileSearchCriteria) getCDF(splitPoints, INCLUSIVE)}
    * @param splitPoints an array of <i>m</i> unique, monotonically increasing items.
    * @return a discrete CDF array of m+1 double ranks (or cumulative probabilities) on the interval [0.0, 1.0].
+   * @throws IllegalArgumentException if sketch is empty.
    */
   public double[] getCDF(final T[] splitPoints) {
     return getCDF(splitPoints, INCLUSIVE);
@@ -299,9 +301,10 @@ public final class ItemsSketch<T> implements QuantilesAPI {
    *
    * @param searchCrit the desired search criteria.
    * @return a discrete CDF array of m+1 double ranks (or cumulative probabilities) on the interval [0.0, 1.0].
+   * @throws IllegalArgumentException if sketch is empty.
    */
   public double[] getCDF(final T[] splitPoints, final QuantileSearchCriteria searchCrit) {
-    if (isEmpty()) { return null; }
+    if (isEmpty()) { throw new IllegalArgumentException(THROWS_EMPTY); }
     refreshSortedView();
     return classicQisSV.getCDF(splitPoints, searchCrit);
   }
@@ -318,8 +321,12 @@ public final class ItemsSketch<T> implements QuantilesAPI {
    * <p>If the sketch is empty this returns null.</p>
    *
    * @return the maximum item of the stream
+   * @throws IllegalArgumentException if sketch is empty.
    */
-  public T getMaxItem() { return maxItem_; }
+  public T getMaxItem() {
+	  if (isEmpty()) { throw new IllegalArgumentException(THROWS_EMPTY); }
+	  return maxItem_;
+  }
 
   /**
    * Returns the minimum item of the stream. This is provided for convenience, but is distinct from the smallest
@@ -328,13 +335,18 @@ public final class ItemsSketch<T> implements QuantilesAPI {
    * <p>If the sketch is empty this returns null.</p>
    *
    * @return the minimum item of the stream
+   * @throws IllegalArgumentException if sketch is empty.
    */
-  public T getMinItem() { return minItem_; }
+  public T getMinItem() {
+	  if (isEmpty()) { throw new IllegalArgumentException(THROWS_EMPTY); }
+	  return minItem_;
+  }
 
   /**
    * This is equivalent to {@link #getPMF(Object[], QuantileSearchCriteria) getPMF(splitPoints, INCLUSIVE)}
    * @param splitPoints an array of <i>m</i> unique, monotonically increasing items.
    * @return a PMF array of m+1 probability masses as doubles on the interval [0.0, 1.0].
+   * @throws IllegalArgumentException if sketch is empty.
    */
   public double[] getPMF(final T[] splitPoints) {
     return getPMF(splitPoints, INCLUSIVE);
@@ -380,9 +392,10 @@ public final class ItemsSketch<T> implements QuantilesAPI {
    *
    * @param searchCrit the desired search criteria.
    * @return a PMF array of m+1 probability masses as doubles on the interval [0.0, 1.0].
+   * @throws IllegalArgumentException if sketch is empty.
    */
   public double[] getPMF(final T[] splitPoints, final QuantileSearchCriteria searchCrit) {
-    if (isEmpty()) { return null; }
+	if (isEmpty()) { throw new IllegalArgumentException(THROWS_EMPTY); }
     refreshSortedView();
     return classicQisSV.getPMF(splitPoints, searchCrit);
   }
@@ -391,6 +404,7 @@ public final class ItemsSketch<T> implements QuantilesAPI {
    * This is equivalent to {@link #getQuantile(double, QuantileSearchCriteria) getQuantile(rank, INCLUSIVE)}
    * @param rank the given normalized rank, a double in the range [0.0, 1.0].
    * @return the approximate quantile given the normalized rank.
+   * @throws IllegalArgumentException if sketch is empty.
    */
   public T getQuantile(final double rank) {
     return getQuantile(rank, INCLUSIVE);
@@ -407,10 +421,11 @@ public final class ItemsSketch<T> implements QuantilesAPI {
    * If EXCLUSIVE, he given rank includes all quantiles &lt;
    * the quantile directly corresponding to the given rank.
    * @return the approximate quantile given the normalized rank.
+   * @throws IllegalArgumentException if sketch is empty.
    * @see org.apache.datasketches.quantilescommon.QuantileSearchCriteria
    */
   public T getQuantile(final double rank, final QuantileSearchCriteria searchCrit) {
-    if (this.isEmpty()) { return null; }
+	if (isEmpty()) { throw new IllegalArgumentException(THROWS_EMPTY); }
     refreshSortedView();
     return classicQisSV.getQuantile(rank, searchCrit);
   }
@@ -421,7 +436,7 @@ public final class ItemsSketch<T> implements QuantilesAPI {
    *
    * <p>If the sketch is empty this returns null.</p>
    *
-   * <p>Although it is possible to estimate the probablity that the true quantile
+   * <p>Although it is possible to estimate the probability that the true quantile
    * exists within the quantile confidence interval specified by the upper and lower quantile bounds,
    * it is not possible to guarantee the width of the quantile confidence interval
    * as an additive or multiplicative percent of the true quantile.</p>
@@ -429,8 +444,10 @@ public final class ItemsSketch<T> implements QuantilesAPI {
    * @param rank the given normalized rank
    * @return the lower bound of the quantile confidence interval in which the quantile of the
    * given rank exists.
+   * @throws IllegalArgumentException if sketch is empty.
    */
   public T getQuantileLowerBound(final double rank) {
+    if (isEmpty()) { throw new IllegalArgumentException(THROWS_EMPTY); }
     return getQuantile(max(0, rank - ClassicUtil.getNormalizedRankError(k_, false)));
   }
 
@@ -440,7 +457,7 @@ public final class ItemsSketch<T> implements QuantilesAPI {
    *
    * <p>If the sketch is empty this returns null.</p>
    *
-   * <p>Although it is possible to estimate the probablity that the true quantile
+   * <p>Although it is possible to estimate the probability that the true quantile
    * exists within the quantile confidence interval specified by the upper and lower quantile bounds,
    * it is not possible to guarantee the width of the quantile interval
    * as an additive or multiplicative percent of the true quantile.</p>
@@ -448,8 +465,10 @@ public final class ItemsSketch<T> implements QuantilesAPI {
    * @param rank the given normalized rank
    * @return the upper bound of the quantile confidence interval in which the true quantile of the
    * given rank exists.
+   * @throws IllegalArgumentException if sketch is empty.
    */
   public T getQuantileUpperBound(final double rank) {
+    if (isEmpty()) { throw new IllegalArgumentException(THROWS_EMPTY); }
     return getQuantile(min(1.0, rank + ClassicUtil.getNormalizedRankError(k_, false)));
   }
 
@@ -458,6 +477,7 @@ public final class ItemsSketch<T> implements QuantilesAPI {
    * @param ranks the given array of normalized ranks, each of which must be
    * in the interval [0.0,1.0].
    * @return an array of quantiles corresponding to the given array of normalized ranks.
+   * @throws IllegalArgumentException if sketch is empty.
    * @deprecated Use {@link #getQuantile(double, QuantileSearchCriteria)
    * getQuantile(rank, searchCrit) in a loop.}
    */
@@ -476,6 +496,7 @@ public final class ItemsSketch<T> implements QuantilesAPI {
    * @param searchCrit if INCLUSIVE, the given ranks include all quantiles &le;
    * the quantile directly corresponding to each rank.
    * @return an array of quantiles corresponding to the given array of normalized ranks.
+   * @throws IllegalArgumentException if sketch is empty.
    * @see org.apache.datasketches.quantilescommon.QuantileSearchCriteria
    * @deprecated Use {@link #getQuantile(double, QuantileSearchCriteria)
    * getQuantile(rank, searchCrit) in a loop.}
@@ -483,7 +504,7 @@ public final class ItemsSketch<T> implements QuantilesAPI {
   @Deprecated
   @SuppressWarnings("unchecked")
   public T[] getQuantiles(final double[] ranks, final QuantileSearchCriteria searchCrit) {
-    if (isEmpty()) { return null; }
+	if (isEmpty()) { throw new IllegalArgumentException(THROWS_EMPTY); }
     refreshSortedView();
     final int len = ranks.length;
     final T[] quantiles = (T[]) Array.newInstance(minItem_.getClass(), len);
@@ -495,8 +516,9 @@ public final class ItemsSketch<T> implements QuantilesAPI {
 
   /**
    * This is equivalent to {@link #getQuantiles(int, QuantileSearchCriteria) getQuantiles(numEvenlySpaced, INCLUSIVE)}
-   * @param numEvenlySpaced number of evenly spaced normalied ranks
+   * @param numEvenlySpaced number of evenly spaced normalized ranks
    * @return an array of quantiles that are evenly spaced by their ranks.
+   * @throws IllegalArgumentException if sketch is empty.
    * @deprecated Use {@link #getQuantile(double, QuantileSearchCriteria)
    * getQuantile(rank, searchCrit) in a loop.}
    */
@@ -526,13 +548,14 @@ public final class ItemsSketch<T> implements QuantilesAPI {
    * @param searchCrit if INCLUSIVE, the given ranks include all quantiles &le; the quantile directly corresponding to
    * each rank.
    * @return an array of quantiles that are evenly spaced by their ranks.
+   * @throws IllegalArgumentException if sketch is empty.
    * @see org.apache.datasketches.quantilescommon.QuantileSearchCriteria
    * @deprecated Use {@link #getQuantile(double, QuantileSearchCriteria)
    * getQuantile(rank, searchCrit) in a loop.}
    */
   @Deprecated
   public T[] getQuantiles(final int numEvenlySpaced, final QuantileSearchCriteria searchCrit) {
-    if (isEmpty()) { return null; }
+    if (isEmpty()) { throw new IllegalArgumentException(THROWS_EMPTY); }
     return getQuantiles(org.apache.datasketches.quantilescommon.QuantilesUtil.evenlySpaced(0.0, 1.0, numEvenlySpaced),
         searchCrit);
   }
@@ -540,7 +563,8 @@ public final class ItemsSketch<T> implements QuantilesAPI {
   /**
    * This is equivalent to {@link #getRank(Object, QuantileSearchCriteria) getRank(quantile, INCLUSIVE)}
    * @param quantile the given quantile
-   * @return the normalized rank corresponding to the given quantile
+   * @return the normalized rank corresponding to the given quantile.
+   * @throws IllegalArgumentException if sketch is empty.
    */
   public double getRank(final T quantile) {
     return getRank(quantile, INCLUSIVE);
@@ -549,16 +573,15 @@ public final class ItemsSketch<T> implements QuantilesAPI {
   /**
    * Gets the normalized rank corresponding to the given a quantile.
    *
-   * <p>If the sketch is empty this returns NaN.</p>
-   *
    * @param quantile the given quantile
    * @param searchCrit if INCLUSIVE the given quantile is included into the rank.
-   * @return the normalized rank corresponding to the given quantile
+   * @return the normalized rank corresponding to the given quantile.
+   * @throws IllegalArgumentException if sketch is empty.
+   * @throws IllegalArgumentException if sketch is empty.
    * @see org.apache.datasketches.quantilescommon.QuantileSearchCriteria
    */
-  public double getRank(final T quantile,
-      final QuantileSearchCriteria searchCrit) {
-    if (isEmpty()) { return Double.NaN; }
+  public double getRank(final T quantile, final QuantileSearchCriteria searchCrit) {
+    if (isEmpty()) { new IllegalArgumentException(THROWS_EMPTY); }
     refreshSortedView();
     return classicQisSV.getRank(quantile, searchCrit);
   }
@@ -587,6 +610,7 @@ public final class ItemsSketch<T> implements QuantilesAPI {
    * This is equivalent to {@link #getRanks(Object[], QuantileSearchCriteria) getRanks(quantiles, INCLUSIVE)}
    * @param quantiles the given array of quantiles
    * @return an array of normalized ranks corresponding to the given array of quantiles.
+   * @throws IllegalArgumentException if sketch is empty.
    * @deprecated Use {@link #getRank(Object, QuantileSearchCriteria)
    * getRank(quantile, searchCrit) in a loop.}
    */
@@ -599,18 +623,18 @@ public final class ItemsSketch<T> implements QuantilesAPI {
    * Gets an array of normalized ranks corresponding to the given array of quantiles and the given
    * search criterion.
    *
-   * <p>If the sketch is empty this returns null.</p>
-   *
    * @param quantiles the given array of quantiles
    * @param searchCrit if INCLUSIVE, the given quantiles include the rank directly corresponding to each quantile.
    * @return an array of normalized ranks corresponding to the given array of quantiles.
+   * @throws IllegalArgumentException if sketch is empty.
+   *
    * @see org.apache.datasketches.quantilescommon.QuantileSearchCriteria
    * @deprecated Use {@link #getRank(Object, QuantileSearchCriteria)
    * getRank(quantile, searchCrit) in a loop.}
    */
   @Deprecated
   public double[] getRanks(final T[] quantiles, final QuantileSearchCriteria searchCrit) {
-    if (this.isEmpty()) { return null; }
+    if (isEmpty()) { new IllegalArgumentException(THROWS_EMPTY); }
     refreshSortedView();
     final int len = quantiles.length;
     final double[] ranks = new double[len];
@@ -652,7 +676,7 @@ public final class ItemsSketch<T> implements QuantilesAPI {
   /**
    * Gets the normalized rank error given k and pmf.
    * Static method version of the {@link #getNormalizedRankError(boolean)}.
-   * @param k the configuation parameter
+   * @param k the configuration parameter
    * @param pmf if true, returns the "double-sided" normalized rank error for the getPMF() function.
    * Otherwise, it is the "single-sided" normalized rank error for all the other queries.
    * @return if pmf is true, the normalized rank error for the getPMF() function.
diff --git a/src/main/java/org/apache/datasketches/quantiles/ItemsSketchSortedView.java b/src/main/java/org/apache/datasketches/quantiles/ItemsSketchSortedView.java
index 5b721165..996ce44c 100644
--- a/src/main/java/org/apache/datasketches/quantiles/ItemsSketchSortedView.java
+++ b/src/main/java/org/apache/datasketches/quantiles/ItemsSketchSortedView.java
@@ -20,6 +20,7 @@
 package org.apache.datasketches.quantiles;
 
 import static org.apache.datasketches.quantilescommon.QuantileSearchCriteria.INCLUSIVE;
+import static org.apache.datasketches.quantilescommon.QuantilesUtil.THROWS_EMPTY;
 
 import java.lang.reflect.Array;
 import java.util.Arrays;
@@ -27,11 +28,11 @@ import java.util.Comparator;
 
 import org.apache.datasketches.common.SketchesStateException;
 import org.apache.datasketches.quantilescommon.GenericInequalitySearch;
+import org.apache.datasketches.quantilescommon.GenericInequalitySearch.Inequality;
 import org.apache.datasketches.quantilescommon.GenericSortedView;
 import org.apache.datasketches.quantilescommon.InequalitySearch;
 import org.apache.datasketches.quantilescommon.QuantileSearchCriteria;
 import org.apache.datasketches.quantilescommon.QuantilesUtil;
-import org.apache.datasketches.quantilescommon.GenericInequalitySearch.Inequality;
 
 /**
  * The SortedView of the Classic Quantiles ItemsSketch.
@@ -92,6 +93,7 @@ public final class ItemsSketchSortedView<T> implements GenericSortedView<T> {
 
   @Override
   public T getQuantile(final double rank, final QuantileSearchCriteria searchCrit) {
+    if (isEmpty()) { throw new IllegalArgumentException(THROWS_EMPTY); }
     QuantilesUtil.checkNormalizedRankBounds(rank);
     final int len = cumWeights.length;
     final long naturalRank = (int)(rank * totalN);
@@ -105,6 +107,7 @@ public final class ItemsSketchSortedView<T> implements GenericSortedView<T> {
 
   @Override
   public double getRank(final T quantile, final QuantileSearchCriteria searchCrit) {
+    if (isEmpty()) { throw new IllegalArgumentException(THROWS_EMPTY); }
     final int len = quantiles.length;
     final Inequality crit = (searchCrit == INCLUSIVE) ? Inequality.LE : Inequality.LT;
     final int index = GenericInequalitySearch.find(quantiles,  0, len - 1, quantile, crit, comparator);
@@ -116,6 +119,7 @@ public final class ItemsSketchSortedView<T> implements GenericSortedView<T> {
 
   @Override //implemented here because it needs the comparator
   public double[] getCDF(final T[] splitPoints, final QuantileSearchCriteria searchCrit) {
+    if (isEmpty()) { throw new IllegalArgumentException(THROWS_EMPTY); }
     ItemsUtil.validateItems(splitPoints, comparator);
     final int len = splitPoints.length + 1;
     final double[] buckets = new double[len];
@@ -128,6 +132,7 @@ public final class ItemsSketchSortedView<T> implements GenericSortedView<T> {
 
   @Override //implemented here because it needs the comparator
   public double[] getPMF(final T[] splitPoints, final QuantileSearchCriteria searchCrit) {
+    if (isEmpty()) { throw new IllegalArgumentException(THROWS_EMPTY); }
     ItemsUtil.validateItems(splitPoints, comparator);
     final double[] buckets = getCDF(splitPoints, searchCrit);
     final int len = buckets.length;
@@ -147,6 +152,11 @@ public final class ItemsSketchSortedView<T> implements GenericSortedView<T> {
     return quantiles.clone();
   }
 
+  @Override
+  public boolean isEmpty() {
+    return totalN == 0;
+  }
+
   @Override
   public ItemsSketchSortedViewIterator<T> iterator() {
     return new ItemsSketchSortedViewIterator<T>(quantiles, cumWeights);
diff --git a/src/main/java/org/apache/datasketches/quantiles/ItemsUtil.java b/src/main/java/org/apache/datasketches/quantiles/ItemsUtil.java
index 4e2cf82e..1e1f6703 100644
--- a/src/main/java/org/apache/datasketches/quantiles/ItemsUtil.java
+++ b/src/main/java/org/apache/datasketches/quantiles/ItemsUtil.java
@@ -151,6 +151,8 @@ final class ItemsUtil {
       final String epsPctStr = String.format("%.3f%%", eps * 100.0);
       final int numSamples = sketch.getNumRetained();
       final String numSampStr = String.format("%,d", numSamples);
+      final T minItem = sketch.isEmpty() ? null : sketch.getMinItem();
+      final T maxItem = sketch.isEmpty() ? null : sketch.getMaxItem();
       sb.append(ClassicUtil.LS).append("### ").append(thisSimpleName).append(" SUMMARY: ").append(ClassicUtil.LS);
       sb.append("   K                            : ").append(k).append(ClassicUtil.LS);
       sb.append("   N                            : ").append(nStr).append(ClassicUtil.LS);
@@ -165,8 +167,8 @@ final class ItemsUtil {
       sb.append("   Preamble Bytes               : ").append(preBytes).append(ClassicUtil.LS);
       sb.append("   Normalized Rank Error        : ").append(epsPctStr).append(LS);
       sb.append("   Normalized Rank Error (PMF)  : ").append(epsPmfPctStr).append(LS);
-      sb.append("   Min Quantile                 : ").append(sketch.getMinItem()).append(ClassicUtil.LS);
-      sb.append("   Max Quantile                 : ").append(sketch.getMaxItem()).append(ClassicUtil.LS);
+      sb.append("   Min Quantile                 : ").append(minItem).append(ClassicUtil.LS);
+      sb.append("   Max Quantile                 : ").append(maxItem).append(ClassicUtil.LS);
       sb.append("### END SKETCH SUMMARY").append(ClassicUtil.LS);
     }
     return sb.toString();
diff --git a/src/main/java/org/apache/datasketches/quantiles/UpdateDoublesSketch.java b/src/main/java/org/apache/datasketches/quantiles/UpdateDoublesSketch.java
index 33b100e8..155001c8 100644
--- a/src/main/java/org/apache/datasketches/quantiles/UpdateDoublesSketch.java
+++ b/src/main/java/org/apache/datasketches/quantiles/UpdateDoublesSketch.java
@@ -81,18 +81,18 @@ public abstract class UpdateDoublesSketch extends DoublesSketch {
   //Puts
 
   /**
-   * Puts the minimum quantile
+   * Puts the minimum item
    *
-   * @param minQuantile the given minimum quantile
+   * @param minItem the given minimum item
    */
-  abstract void putMinQuantile(double minQuantile);
+  abstract void putMinItem(double minItem);
 
   /**
-   * Puts the max quantile
+   * Puts the max item
    *
-   * @param maxQuantile the given maximum quantile
+   * @param maxItem the given maximum item
    */
-  abstract void putMaxQuantile(double maxQuantile);
+  abstract void putMaxItem(double maxItem);
 
   /**
    * Puts the long <i>n</i>
diff --git a/src/main/java/org/apache/datasketches/quantilescommon/DoublesSortedView.java b/src/main/java/org/apache/datasketches/quantilescommon/DoublesSortedView.java
index fd3f4f90..3909b1ab 100644
--- a/src/main/java/org/apache/datasketches/quantilescommon/DoublesSortedView.java
+++ b/src/main/java/org/apache/datasketches/quantilescommon/DoublesSortedView.java
@@ -30,14 +30,13 @@ public interface DoublesSortedView extends SortedView {
   /**
    * Gets the approximate quantile of the given normalized rank and the given search criterion.
    *
-   * <p>If the sketch is empty this returns NaN.</p>
-   *
    * @param rank the given normalized rank, a double in the range [0.0, 1.0].
    * @param searchCrit If INCLUSIVE, the given rank includes all quantiles &le;
    * the quantile directly corresponding to the given rank.
    * If EXCLUSIVE, he given rank includes all quantiles &lt;
    * the quantile directly corresponding to the given rank.
    * @return the approximate quantile given the normalized rank.
+   * @throws IllegalArgumentException if sketch is empty.
    * @see org.apache.datasketches.quantilescommon.QuantileSearchCriteria
    */
   double getQuantile(double rank, QuantileSearchCriteria searchCrit);
@@ -45,11 +44,10 @@ public interface DoublesSortedView extends SortedView {
   /**
    * Gets the normalized rank corresponding to the given a quantile.
    *
-   * <p>If the sketch is empty this returns NaN.</p>
-   *
    * @param quantile the given quantile
    * @param searchCrit if INCLUSIVE the given quantile is included into the rank.
-   * @return the normalized rank corresponding to the given quantile
+   * @return the normalized rank corresponding to the given quantile.
+   * @throws IllegalArgumentException if sketch is empty.
    * @see org.apache.datasketches.quantilescommon.QuantileSearchCriteria
    */
   double getRank(double quantile, QuantileSearchCriteria searchCrit);
@@ -59,8 +57,6 @@ public interface DoublesSortedView extends SortedView {
    * as a monotonically increasing array of double ranks (or cumulative probabilities) on the interval [0.0, 1.0],
    * given a set of splitPoints.
    *
-   * <p>If the sketch is empty this returns null.</p>
-   *
    * <p>The resulting approximations have a probabilistic guarantee that can be obtained from the
    * getNormalizedRankError(false) function.</p>
    *
@@ -87,6 +83,7 @@ public interface DoublesSortedView extends SortedView {
    *
    * @param searchCrit the desired search criteria.
    * @return a discrete CDF array of m+1 double ranks (or cumulative probabilities) on the interval [0.0, 1.0].
+   * @throws IllegalArgumentException if sketch is empty.
    */
   default double[] getCDF(double[] splitPoints, QuantileSearchCriteria searchCrit) {
     QuantilesUtil.checkDoublesSplitPointsOrder(splitPoints);
@@ -107,8 +104,6 @@ public interface DoublesSortedView extends SortedView {
    * <p>The resulting approximations have a probabilistic guarantee that can be obtained from the
    * getNormalizedRankError(true) function.</p>
    *
-   * <p>If the sketch is empty this returns null.</p>
-   *
    * @param splitPoints an array of <i>m</i> unique, monotonically increasing items
    * (of the same type as the input items)
    * that divide the item input domain into <i>m+1</i> consecutive, non-overlapping intervals.
@@ -139,6 +134,7 @@ public interface DoublesSortedView extends SortedView {
    *
    * @param searchCrit the desired search criteria.
    * @return a PMF array of m+1 probability masses as doubles on the interval [0.0, 1.0].
+   * @throws IllegalArgumentException if sketch is empty.
    */
   default double[] getPMF(double[] splitPoints,  QuantileSearchCriteria searchCrit) {
     final double[] buckets = getCDF(splitPoints, searchCrit);
diff --git a/src/main/java/org/apache/datasketches/quantilescommon/FloatsSortedView.java b/src/main/java/org/apache/datasketches/quantilescommon/FloatsSortedView.java
index 2a0761b8..929cfc05 100644
--- a/src/main/java/org/apache/datasketches/quantilescommon/FloatsSortedView.java
+++ b/src/main/java/org/apache/datasketches/quantilescommon/FloatsSortedView.java
@@ -30,14 +30,13 @@ public interface FloatsSortedView extends SortedView {
   /**
    * Gets the approximate quantile of the given normalized rank and the given search criterion.
    *
-   * <p>If the sketch is empty this returns NaN.</p>
-   *
    * @param rank the given normalized rank, a double in the range [0.0, 1.0].
    * @param searchCrit If INCLUSIVE, the given rank includes all quantiles &le;
    * the quantile directly corresponding to the given rank.
    * If EXCLUSIVE, he given rank includes all quantiles &lt;
    * the quantile directly corresponding to the given rank.
    * @return the approximate quantile given the normalized rank.
+   * @throws IllegalArgumentException if sketch is empty.
    * @see org.apache.datasketches.quantilescommon.QuantileSearchCriteria
    */
   float getQuantile(double rank, QuantileSearchCriteria searchCrit);
@@ -45,11 +44,10 @@ public interface FloatsSortedView extends SortedView {
   /**
    * Gets the normalized rank corresponding to the given a quantile.
    *
-   * <p>If the sketch is empty this returns NaN.</p>
-   *
    * @param quantile the given quantile
    * @param searchCrit if INCLUSIVE the given quantile is included into the rank.
-   * @return the normalized rank corresponding to the given quantile
+   * @return the normalized rank corresponding to the given quantile.
+   * @throws IllegalArgumentException if sketch is empty.
    * @see org.apache.datasketches.quantilescommon.QuantileSearchCriteria
    */
   double getRank(float quantile, QuantileSearchCriteria searchCrit);
@@ -59,8 +57,6 @@ public interface FloatsSortedView extends SortedView {
    * as a monotonically increasing array of double ranks (or cumulative probabilities) on the interval [0.0, 1.0],
    * given a set of splitPoints.
    *
-   * <p>If the sketch is empty this returns null.</p>
-   *
    * <p>The resulting approximations have a probabilistic guarantee that can be obtained from the
    * getNormalizedRankError(false) function.</p>
    *
@@ -87,6 +83,7 @@ public interface FloatsSortedView extends SortedView {
    *
    * @param searchCrit the desired search criteria.
    * @return a discrete CDF array of m+1 double ranks (or cumulative probabilities) on the interval [0.0, 1.0].
+   * @throws IllegalArgumentException if sketch is empty.
    */
   default double[] getCDF(float[] splitPoints, QuantileSearchCriteria searchCrit) {
     QuantilesUtil.checkFloatsSplitPointsOrder(splitPoints);
@@ -107,8 +104,6 @@ public interface FloatsSortedView extends SortedView {
    * <p>The resulting approximations have a probabilistic guarantee that can be obtained from the
    * getNormalizedRankError(true) function.</p>
    *
-   * <p>If the sketch is empty this returns null.</p>
-   *
    * @param splitPoints an array of <i>m</i> unique, monotonically increasing items
    * (of the same type as the input items)
    * that divide the item input domain into <i>m+1</i> consecutive, non-overlapping intervals.
@@ -139,6 +134,7 @@ public interface FloatsSortedView extends SortedView {
    *
    * @param searchCrit the desired search criteria.
    * @return a PMF array of m+1 probability masses as doubles on the interval [0.0, 1.0].
+   * @throws IllegalArgumentException if sketch is empty.
    */
   default double[] getPMF(float[] splitPoints,  QuantileSearchCriteria searchCrit) {
     final double[] buckets = getCDF(splitPoints, searchCrit);
diff --git a/src/main/java/org/apache/datasketches/quantilescommon/GenericSortedView.java b/src/main/java/org/apache/datasketches/quantilescommon/GenericSortedView.java
index 58df7bd1..f2d46cab 100644
--- a/src/main/java/org/apache/datasketches/quantilescommon/GenericSortedView.java
+++ b/src/main/java/org/apache/datasketches/quantilescommon/GenericSortedView.java
@@ -31,14 +31,13 @@ public interface GenericSortedView<T> extends SortedView {
   /**
    * Gets the approximate quantile of the given normalized rank and the given search criterion.
    *
-   * <p>If the sketch is empty this returns null.</p>
-   *
    * @param rank the given normalized rank, a double in the range [0.0, 1.0].
    * @param searchCrit If INCLUSIVE, the given rank includes all quantiles &le;
    * the quantile directly corresponding to the given rank.
    * If EXCLUSIVE, he given rank includes all quantiles &lt;
    * the quantile directly corresponding to the given rank.
    * @return the approximate quantile given the normalized rank.
+   * @throws IllegalArgumentException if sketch is empty.
    * @see org.apache.datasketches.quantilescommon.QuantileSearchCriteria
    */
   T getQuantile(double rank, QuantileSearchCriteria searchCrit);
@@ -46,11 +45,10 @@ public interface GenericSortedView<T> extends SortedView {
   /**
    * Gets the normalized rank corresponding to the given a quantile.
    *
-   * <p>If the sketch is empty this returns null.</p>
-   *
    * @param quantile the given quantile
    * @param searchCrit if INCLUSIVE the given quantile is included into the rank.
-   * @return the normalized rank corresponding to the given quantile
+   * @return the normalized rank corresponding to the given quantile.
+   * @throws IllegalArgumentException if sketch is empty.
    * @see org.apache.datasketches.quantilescommon.QuantileSearchCriteria
    */
   double getRank(T quantile, QuantileSearchCriteria searchCrit);
@@ -88,6 +86,7 @@ public interface GenericSortedView<T> extends SortedView {
    *
    * @param searchCrit the desired search criteria.
    * @return a discrete CDF array of m+1 double ranks (or cumulative probabilities) on the interval [0.0, 1.0].
+   * @throws IllegalArgumentException if sketch is empty.
    */
   double[] getCDF(T[] splitPoints, QuantileSearchCriteria searchCrit);
 
@@ -99,8 +98,6 @@ public interface GenericSortedView<T> extends SortedView {
    * <p>The resulting approximations have a probabilistic guarantee that can be obtained from the
    * getNormalizedRankError(true) function.</p>
    *
-   * <p>If the sketch is empty this returns null.</p>
-   *
    * @param splitPoints an array of <i>m</i> unique, monotonically increasing items
    * (of the same type as the input items)
    * that divide the item input domain into <i>m+1</i> consecutive, non-overlapping intervals.
@@ -131,6 +128,7 @@ public interface GenericSortedView<T> extends SortedView {
    *
    * @param searchCrit the desired search criteria.
    * @return a PMF array of m+1 probability masses as doubles on the interval [0.0, 1.0].
+   * @throws IllegalArgumentException if sketch is empty.
    */
   double[] getPMF(T[] splitPoints,  QuantileSearchCriteria searchCrit);
 
diff --git a/src/main/java/org/apache/datasketches/quantilescommon/QuantilesDoublesAPI.java b/src/main/java/org/apache/datasketches/quantilescommon/QuantilesDoublesAPI.java
index 97f904ec..8613a419 100644
--- a/src/main/java/org/apache/datasketches/quantilescommon/QuantilesDoublesAPI.java
+++ b/src/main/java/org/apache/datasketches/quantilescommon/QuantilesDoublesAPI.java
@@ -33,6 +33,7 @@ public interface QuantilesDoublesAPI extends QuantilesAPI {
    * This is equivalent to {@link #getCDF(double[], QuantileSearchCriteria) getCDF(splitPoints, INCLUSIVE)}
    * @param splitPoints an array of <i>m</i> unique, monotonically increasing items.
    * @return a discrete CDF array of m+1 double ranks (or cumulative probabilities) on the interval [0.0, 1.0].
+   * @throws IllegalArgumentException if sketch is empty.
    */
   default double[] getCDF(double[] splitPoints) {
     return getCDF(splitPoints, INCLUSIVE);
@@ -43,8 +44,6 @@ public interface QuantilesDoublesAPI extends QuantilesAPI {
    * as a monotonically increasing array of double ranks (or cumulative probabilities) on the interval [0.0, 1.0],
    * given a set of splitPoints.
    *
-   * <p>If the sketch is empty this returns null.</p>
-   *
    * <p>The resulting approximations have a probabilistic guarantee that can be obtained from the
    * getNormalizedRankError(false) function.</p>
    *
@@ -71,6 +70,7 @@ public interface QuantilesDoublesAPI extends QuantilesAPI {
    *
    * @param searchCrit the desired search criteria.
    * @return a discrete CDF array of m+1 double ranks (or cumulative probabilities) on the interval [0.0, 1.0].
+   * @throws IllegalArgumentException if sketch is empty.
    */
   double[] getCDF(double[] splitPoints, QuantileSearchCriteria searchCrit);
 
@@ -78,9 +78,8 @@ public interface QuantilesDoublesAPI extends QuantilesAPI {
    * Returns the maximum item of the stream. This is provided for convenience, but may be different from the largest
    * item retained by the sketch algorithm.
    *
-   * <p>If the sketch is empty this returns NaN.</p>
-   *
    * @return the maximum item of the stream
+   * @throws IllegalArgumentException if sketch is empty.
    */
   double getMaxItem();
 
@@ -88,9 +87,8 @@ public interface QuantilesDoublesAPI extends QuantilesAPI {
    * Returns the minimum item of the stream. This is provided for convenience, but is distinct from the smallest
    * item retained by the sketch algorithm.
    *
-   * <p>If the sketch is empty this returns NaN.</p>
-   *
    * @return the minimum item of the stream
+   * @throws IllegalArgumentException if sketch is empty.
    */
   double getMinItem();
 
@@ -98,6 +96,7 @@ public interface QuantilesDoublesAPI extends QuantilesAPI {
    * This is equivalent to {@link #getPMF(double[], QuantileSearchCriteria) getPMF(splitPoints, INCLUSIVE)}
    * @param splitPoints an array of <i>m</i> unique, monotonically increasing items.
    * @return a PMF array of m+1 probability masses as doubles on the interval [0.0, 1.0].
+   * @throws IllegalArgumentException if sketch is empty.
    */
   default double[] getPMF(double[] splitPoints) {
     return getPMF(splitPoints, INCLUSIVE);
@@ -111,8 +110,6 @@ public interface QuantilesDoublesAPI extends QuantilesAPI {
    * <p>The resulting approximations have a probabilistic guarantee that can be obtained from the
    * getNormalizedRankError(true) function.</p>
    *
-   * <p>If the sketch is empty this returns null.</p>
-   *
    * @param splitPoints an array of <i>m</i> unique, monotonically increasing items
    * (of the same type as the input items)
    * that divide the item input domain into <i>m+1</i> consecutive, non-overlapping intervals.
@@ -143,6 +140,7 @@ public interface QuantilesDoublesAPI extends QuantilesAPI {
    *
    * @param searchCrit the desired search criteria.
    * @return a PMF array of m+1 probability masses as doubles on the interval [0.0, 1.0].
+   * @throws IllegalArgumentException if sketch is empty.
    */
   double[] getPMF(double[] splitPoints, QuantileSearchCriteria searchCrit);
 
@@ -150,6 +148,7 @@ public interface QuantilesDoublesAPI extends QuantilesAPI {
    * This is equivalent to {@link #getQuantile(double, QuantileSearchCriteria) getQuantile(rank, INCLUSIVE)}
    * @param rank the given normalized rank, a double in the range [0.0, 1.0].
    * @return the approximate quantile given the normalized rank.
+   * @throws IllegalArgumentException if sketch is empty.
    */
   default double getQuantile(double rank) {
     return getQuantile(rank, INCLUSIVE);
@@ -158,14 +157,13 @@ public interface QuantilesDoublesAPI extends QuantilesAPI {
   /**
    * Gets the approximate quantile of the given normalized rank and the given search criterion.
    *
-   * <p>If the sketch is empty this returns NaN.</p>
-   *
    * @param rank the given normalized rank, a double in the range [0.0, 1.0].
    * @param searchCrit If INCLUSIVE, the given rank includes all quantiles &le;
    * the quantile directly corresponding to the given rank.
    * If EXCLUSIVE, he given rank includes all quantiles &lt;
    * the quantile directly corresponding to the given rank.
    * @return the approximate quantile given the normalized rank.
+   * @throws IllegalArgumentException if sketch is empty.
    * @see org.apache.datasketches.quantilescommon.QuantileSearchCriteria
    */
   double getQuantile(double rank, QuantileSearchCriteria searchCrit);
@@ -174,8 +172,6 @@ public interface QuantilesDoublesAPI extends QuantilesAPI {
    * Gets the lower bound of the quantile confidence interval in which the quantile of the
    * given rank exists.
    *
-   * <p>If the sketch is empty this returns NaN.</p>
-   *
    * <p>Although it is possible to estimate the probablity that the true quantile
    * exists within the quantile confidence interval specified by the upper and lower quantile bounds,
    * it is not possible to guarantee the width of the quantile confidence interval
@@ -184,6 +180,7 @@ public interface QuantilesDoublesAPI extends QuantilesAPI {
    * @param rank the given normalized rank
    * @return the lower bound of the quantile confidence interval in which the quantile of the
    * given rank exists.
+   * @throws IllegalArgumentException if sketch is empty.
    */
   double getQuantileLowerBound(double rank);
 
@@ -191,8 +188,6 @@ public interface QuantilesDoublesAPI extends QuantilesAPI {
    * Gets the upper bound of the quantile confidence interval in which the true quantile of the
    * given rank exists.
    *
-   * <p>If the sketch is empty this returns NaN.</p>
-   *
    * <p>Although it is possible to estimate the probablity that the true quantile
    * exists within the quantile confidence interval specified by the upper and lower quantile bounds,
    * it is not possible to guarantee the width of the quantile interval
@@ -201,6 +196,7 @@ public interface QuantilesDoublesAPI extends QuantilesAPI {
    * @param rank the given normalized rank
    * @return the upper bound of the quantile confidence interval in which the true quantile of the
    * given rank exists.
+   * @throws IllegalArgumentException if sketch is empty.
    */
   double getQuantileUpperBound(double rank);
 
@@ -209,6 +205,7 @@ public interface QuantilesDoublesAPI extends QuantilesAPI {
    * @param ranks the given array of normalized ranks, each of which must be
    * in the interval [0.0,1.0].
    * @return an array of quantiles corresponding to the given array of normalized ranks.
+   * @throws IllegalArgumentException if sketch is empty.
    * @deprecated Use {@link #getQuantile(double, QuantileSearchCriteria)
    * getQuantile(rank, searchCrit) in a loop.}
    */
@@ -220,13 +217,12 @@ public interface QuantilesDoublesAPI extends QuantilesAPI {
   /**
    * Gets an array of quantiles from the given array of normalized ranks.
    *
-   * <p>If the sketch is empty this returns null.</p>
-   *
    * @param ranks the given array of normalized ranks, each of which must be
    * in the interval [0.0,1.0].
    * @param searchCrit if INCLUSIVE, the given ranks include all quantiles &le;
    * the quantile directly corresponding to each rank.
    * @return an array of quantiles corresponding to the given array of normalized ranks.
+   * @throws IllegalArgumentException if sketch is empty.
    * @see org.apache.datasketches.quantilescommon.QuantileSearchCriteria
    * @deprecated Use {@link #getQuantile(double, QuantileSearchCriteria)
    * getQuantile(rank, searchCrit) in a loop.}
@@ -236,8 +232,9 @@ public interface QuantilesDoublesAPI extends QuantilesAPI {
 
   /**
    * This is equivalent to {@link #getQuantiles(int, QuantileSearchCriteria) getQuantiles(numEvenlySpaced, INCLUSIVE)}
-   * @param numEvenlySpaced number of evenly spaced normalied ranks
+   * @param numEvenlySpaced number of evenly spaced normalized ranks
    * @return an array of quantiles that are evenly spaced by their ranks.
+   * @throws IllegalArgumentException if sketch is empty.
    * @deprecated Use {@link #getQuantile(double, QuantileSearchCriteria)
    * getQuantile(rank, searchCrit) in a loop.}
    */
@@ -250,8 +247,6 @@ public interface QuantilesDoublesAPI extends QuantilesAPI {
    * This is a version of getQuantiles() where the caller only specifies the number of of desired evenly spaced,
    * normalized ranks, and returns an array of the corresponding quantiles.
    *
-   * <p>If the sketch is empty this returns null.</p>
-   *
    * @param numEvenlySpaced an integer that specifies the number of evenly spaced normalized ranks.
    * This must be a positive integer greater than 0.
    * <ul><li>Let <i>Smallest</i> and <i>Largest</i> be the smallest and largest quantiles
@@ -267,6 +262,7 @@ public interface QuantilesDoublesAPI extends QuantilesAPI {
    * @param searchCrit if INCLUSIVE, the given ranks include all quantiles &le; the quantile directly corresponding to
    * each rank.
    * @return an array of quantiles that are evenly spaced by their ranks.
+   * @throws IllegalArgumentException if sketch is empty.
    * @see org.apache.datasketches.quantilescommon.QuantileSearchCriteria
    * @deprecated Use {@link #getQuantile(double, QuantileSearchCriteria)
    * getQuantile(rank, searchCrit) in a loop.}
@@ -278,6 +274,7 @@ public interface QuantilesDoublesAPI extends QuantilesAPI {
    * This is equivalent to {@link #getRank(double, QuantileSearchCriteria) getRank(quantile, INCLUSIVE)}
    * @param quantile the given quantile
    * @return the normalized rank corresponding to the given quantile
+   * @throws IllegalArgumentException if sketch is empty.
    */
   default double getRank(double quantile) {
     return getRank(quantile, INCLUSIVE);
@@ -286,11 +283,10 @@ public interface QuantilesDoublesAPI extends QuantilesAPI {
   /**
    * Gets the normalized rank corresponding to the given a quantile.
    *
-   * <p>If the sketch is empty this returns NaN.</p>
-   *
    * @param quantile the given quantile
    * @param searchCrit if INCLUSIVE the given quantile is included into the rank.
    * @return the normalized rank corresponding to the given quantile
+   * @throws IllegalArgumentException if sketch is empty.
    * @see org.apache.datasketches.quantilescommon.QuantileSearchCriteria
    */
   double getRank(double quantile, QuantileSearchCriteria searchCrit);
@@ -299,6 +295,7 @@ public interface QuantilesDoublesAPI extends QuantilesAPI {
    * This is equivalent to {@link #getRanks(double[], QuantileSearchCriteria) getRanks(quantiles, INCLUSIVE)}
    * @param quantiles the given array of quantiles
    * @return an array of normalized ranks corresponding to the given array of quantiles.
+   * @throws IllegalArgumentException if sketch is empty.
    * @deprecated Use {@link #getRank(double, QuantileSearchCriteria)
    * getRank(quantile, searchCrit) in a loop.}
    */
@@ -311,11 +308,10 @@ public interface QuantilesDoublesAPI extends QuantilesAPI {
    * Gets an array of normalized ranks corresponding to the given array of quantiles and the given
    * search criterion.
    *
-   * <p>If the sketch is empty this returns null.</p>
-   *
    * @param quantiles the given array of quantiles
    * @param searchCrit if INCLUSIVE, the given quantiles include the rank directly corresponding to each quantile.
    * @return an array of normalized ranks corresponding to the given array of quantiles.
+   * @throws IllegalArgumentException if sketch is empty.
    * @see org.apache.datasketches.quantilescommon.QuantileSearchCriteria
    * @deprecated Use {@link #getRank(double, QuantileSearchCriteria)
    * getRank(quantile, searchCrit) in a loop.}
diff --git a/src/main/java/org/apache/datasketches/quantilescommon/QuantilesFloatsAPI.java b/src/main/java/org/apache/datasketches/quantilescommon/QuantilesFloatsAPI.java
index ee195d72..57d8b231 100644
--- a/src/main/java/org/apache/datasketches/quantilescommon/QuantilesFloatsAPI.java
+++ b/src/main/java/org/apache/datasketches/quantilescommon/QuantilesFloatsAPI.java
@@ -32,6 +32,7 @@ public interface QuantilesFloatsAPI extends QuantilesAPI {
    * This is equivalent to {@link #getCDF(float[], QuantileSearchCriteria) getCDF(splitPoints, INCLUSIVE)}
    * @param splitPoints an array of <i>m</i> unique, monotonically increasing items.
    * @return a discrete CDF array of m+1 double ranks (or cumulative probabilities) on the interval [0.0, 1.0].
+   * @throws IllegalArgumentException if sketch is empty.
    */
   default double[] getCDF(float[] splitPoints) {
     return getCDF(splitPoints, INCLUSIVE);
@@ -42,8 +43,6 @@ public interface QuantilesFloatsAPI extends QuantilesAPI {
    * as a monotonically increasing array of double ranks (or cumulative probabilities) on the interval [0.0, 1.0],
    * given a set of splitPoints.
    *
-   * <p>If the sketch is empty this returns null.</p>
-   *
    * <p>The resulting approximations have a probabilistic guarantee that can be obtained from the
    * getNormalizedRankError(false) function.</p>
    *
@@ -70,6 +69,7 @@ public interface QuantilesFloatsAPI extends QuantilesAPI {
    *
    * @param searchCrit the desired search criteria.
    * @return a discrete CDF array of m+1 double ranks (or cumulative probabilities) on the interval [0.0, 1.0].
+   * @throws IllegalArgumentException if sketch is empty.
    */
   double[] getCDF(float[] splitPoints, QuantileSearchCriteria searchCrit);
 
@@ -77,9 +77,8 @@ public interface QuantilesFloatsAPI extends QuantilesAPI {
    * Returns the maximum item of the stream. This is provided for convenience, but may be different from the largest
    * item retained by the sketch algorithm.
    *
-   * <p>If the sketch is empty this returns NaN.</p>
-   *
    * @return the maximum item of the stream
+   * @throws IllegalArgumentException if sketch is empty.
    */
   float getMaxItem();
 
@@ -87,9 +86,8 @@ public interface QuantilesFloatsAPI extends QuantilesAPI {
    * Returns the minimum item of the stream. This is provided for convenience, but is distinct from the smallest
    * item retained by the sketch algorithm.
    *
-   * <p>If the sketch is empty this returns NaN.</p>
-   *
    * @return the minimum item of the stream
+   * @throws IllegalArgumentException if sketch is empty.
    */
   float getMinItem();
 
@@ -97,6 +95,7 @@ public interface QuantilesFloatsAPI extends QuantilesAPI {
    * This is equivalent to {@link #getPMF(float[], QuantileSearchCriteria) getPMF(splitPoints, INCLUSIVE)}
    * @param splitPoints an array of <i>m</i> unique, monotonically increasing items.
    * @return a PMF array of m+1 probability masses as doubles on the interval [0.0, 1.0].
+   * @throws IllegalArgumentException if sketch is empty.
    */
   default double[] getPMF(float[] splitPoints) {
     return getPMF(splitPoints, INCLUSIVE);
@@ -110,8 +109,6 @@ public interface QuantilesFloatsAPI extends QuantilesAPI {
    * <p>The resulting approximations have a probabilistic guarantee that can be obtained from the
    * getNormalizedRankError(true) function.</p>
    *
-   * <p>If the sketch is empty this returns null.</p>
-   *
    * @param splitPoints an array of <i>m</i> unique, monotonically increasing items
    * (of the same type as the input items)
    * that divide the item input domain into <i>m+1</i> consecutive, non-overlapping intervals.
@@ -142,6 +139,7 @@ public interface QuantilesFloatsAPI extends QuantilesAPI {
    *
    * @param searchCrit the desired search criteria.
    * @return a PMF array of m+1 probability masses as doubles on the interval [0.0, 1.0].
+   * @throws IllegalArgumentException if sketch is empty.
    */
   double[] getPMF(float[] splitPoints, QuantileSearchCriteria searchCrit);
 
@@ -149,6 +147,7 @@ public interface QuantilesFloatsAPI extends QuantilesAPI {
    * This is equivalent to {@link #getQuantile(double, QuantileSearchCriteria) getQuantile(rank, INCLUSIVE)}
    * @param rank the given normalized rank, a double in the range [0.0, 1.0].
    * @return the approximate quantile given the normalized rank.
+   * @throws IllegalArgumentException if sketch is empty.
    */
   default float getQuantile(double rank) {
     return getQuantile(rank, INCLUSIVE);
@@ -157,14 +156,13 @@ public interface QuantilesFloatsAPI extends QuantilesAPI {
   /**
    * Gets the approximate quantile of the given normalized rank and the given search criterion.
    *
-   * <p>If the sketch is empty this returns NaN.</p>
-   *
    * @param rank the given normalized rank, a double in the range [0.0, 1.0].
    * @param searchCrit If INCLUSIVE, the given rank includes all quantiles &le;
    * the quantile directly corresponding to the given rank.
    * If EXCLUSIVE, he given rank includes all quantiles &lt;
    * the quantile directly corresponding to the given rank.
    * @return the approximate quantile given the normalized rank.
+   * @throws IllegalArgumentException if sketch is empty.
    * @see org.apache.datasketches.quantilescommon.QuantileSearchCriteria
    */
   float getQuantile(double rank, QuantileSearchCriteria searchCrit);
@@ -173,8 +171,6 @@ public interface QuantilesFloatsAPI extends QuantilesAPI {
    * Gets the lower bound of the quantile confidence interval in which the quantile of the
    * given rank exists.
    *
-   * <p>If the sketch is empty this returns NaN.</p>
-   *
    * <p>Although it is possible to estimate the probablity that the true quantile
    * exists within the quantile confidence interval specified by the upper and lower quantile bounds,
    * it is not possible to guarantee the width of the quantile confidence interval
@@ -183,6 +179,7 @@ public interface QuantilesFloatsAPI extends QuantilesAPI {
    * @param rank the given normalized rank
    * @return the lower bound of the quantile confidence interval in which the quantile of the
    * given rank exists.
+   * @throws IllegalArgumentException if sketch is empty.
    */
   float getQuantileLowerBound(double rank);
 
@@ -190,8 +187,6 @@ public interface QuantilesFloatsAPI extends QuantilesAPI {
    * Gets the upper bound of the quantile confidence interval in which the true quantile of the
    * given rank exists.
    *
-   * <p>If the sketch is empty this returns NaN.</p>
-   *
    * <p>Although it is possible to estimate the probablity that the true quantile
    * exists within the quantile confidence interval specified by the upper and lower quantile bounds,
    * it is not possible to guarantee the width of the quantile interval
@@ -200,6 +195,7 @@ public interface QuantilesFloatsAPI extends QuantilesAPI {
    * @param rank the given normalized rank
    * @return the upper bound of the quantile confidence interval in which the true quantile of the
    * given rank exists.
+   * @throws IllegalArgumentException if sketch is empty.
    */
   float getQuantileUpperBound(double rank);
 
@@ -208,6 +204,7 @@ public interface QuantilesFloatsAPI extends QuantilesAPI {
    * @param ranks the given array of normalized ranks, each of which must be
    * in the interval [0.0,1.0].
    * @return an array of quantiles corresponding to the given array of normalized ranks.
+   * @throws IllegalArgumentException if sketch is empty.
    * @deprecated Use {@link #getQuantile(double, QuantileSearchCriteria)
    * getQuantile(rank, searchCrit) in a loop.}
    */
@@ -219,13 +216,12 @@ public interface QuantilesFloatsAPI extends QuantilesAPI {
   /**
    * Gets an array of quantiles from the given array of normalized ranks.
    *
-   * <p>If the sketch is empty this returns null.</p>
-   *
    * @param ranks the given array of normalized ranks, each of which must be
    * in the interval [0.0,1.0].
    * @param searchCrit if INCLUSIVE, the given ranks include all quantiles &le;
    * the quantile directly corresponding to each rank.
    * @return an array of quantiles corresponding to the given array of normalized ranks.
+   * @throws IllegalArgumentException if sketch is empty.
    * @see org.apache.datasketches.quantilescommon.QuantileSearchCriteria
    * @deprecated Use {@link #getQuantile(double, QuantileSearchCriteria)
    * getQuantile(rank, searchCrit) in a loop.}
@@ -235,8 +231,9 @@ public interface QuantilesFloatsAPI extends QuantilesAPI {
 
   /**
    * This is equivalent to {@link #getQuantiles(int, QuantileSearchCriteria) getQuantiles(numEvenlySpaced, INCLUSIVE)}
-   * @param numEvenlySpaced number of evenly spaced normalied ranks
+   * @param numEvenlySpaced number of evenly spaced normalized ranks
    * @return an array of quantiles that are evenly spaced by their ranks.
+   * @throws IllegalArgumentException if sketch is empty.
    * @deprecated Use {@link #getQuantile(double, QuantileSearchCriteria)
    * getQuantile(rank, searchCrit) in a loop.}
    */
@@ -249,8 +246,6 @@ public interface QuantilesFloatsAPI extends QuantilesAPI {
    * This is a version of getQuantiles() where the caller only specifies the number of of desired evenly spaced,
    * normalized ranks, and returns an array of the corresponding quantiles.
    *
-   * <p>If the sketch is empty this returns null.</p>
-   *
    * @param numEvenlySpaced an integer that specifies the number of evenly spaced normalized ranks.
    * This must be a positive integer greater than 0.
    * <ul><li>Let <i>Smallest</i> and <i>Largest</i> be the smallest and largest quantiles
@@ -266,6 +261,7 @@ public interface QuantilesFloatsAPI extends QuantilesAPI {
    * @param searchCrit if INCLUSIVE, the given ranks include all quantiles &le; the quantile directly corresponding to
    * each rank.
    * @return an array of quantiles that are evenly spaced by their ranks.
+   * @throws IllegalArgumentException if sketch is empty.
    * @see org.apache.datasketches.quantilescommon.QuantileSearchCriteria
    * @deprecated Use {@link #getQuantile(double, QuantileSearchCriteria)
    * getQuantile(rank, searchCrit) in a loop.}
@@ -276,7 +272,8 @@ public interface QuantilesFloatsAPI extends QuantilesAPI {
   /**
    * This is equivalent to {@link #getRank(float, QuantileSearchCriteria) getRank(quantile, INCLUSIVE)}
    * @param quantile the given quantile
-   * @return the normalized rank corresponding to the given quantile
+   * @return the normalized rank corresponding to the given quantile.
+   * @throws IllegalArgumentException if sketch is empty.
    */
   default double getRank(float quantile) {
     return getRank(quantile, INCLUSIVE);
@@ -285,11 +282,10 @@ public interface QuantilesFloatsAPI extends QuantilesAPI {
   /**
    * Gets the normalized rank corresponding to the given a quantile.
    *
-   * <p>If the sketch is empty this returns NaN.</p>
-   *
    * @param quantile the given quantile
    * @param searchCrit if INCLUSIVE the given quantile is included into the rank.
-   * @return the normalized rank corresponding to the given quantile
+   * @return the normalized rank corresponding to the given quantile.
+   * @throws IllegalArgumentException if sketch is empty.
    * @see org.apache.datasketches.quantilescommon.QuantileSearchCriteria
    */
   double getRank(float quantile, QuantileSearchCriteria searchCrit);
@@ -298,6 +294,7 @@ public interface QuantilesFloatsAPI extends QuantilesAPI {
    * This is equivalent to {@link #getRanks(float[], QuantileSearchCriteria) getRanks(quantiles, INCLUSIVE)}
    * @param quantiles the given array of quantiles
    * @return an array of normalized ranks corresponding to the given array of quantiles.
+   * @throws IllegalArgumentException if sketch is empty.
    * @deprecated Use {@link #getRank(float, QuantileSearchCriteria)
    * getRank(quantile, searchCrit) in a loop.}
    */
@@ -310,11 +307,10 @@ public interface QuantilesFloatsAPI extends QuantilesAPI {
    * Gets an array of normalized ranks corresponding to the given array of quantiles and the given
    * search criterion.
    *
-   * <p>If the sketch is empty this returns null.</p>
-   *
    * @param quantiles the given array of quantiles
    * @param searchCrit if INCLUSIVE, the given quantiles include the rank directly corresponding to each quantile.
    * @return an array of normalized ranks corresponding to the given array of quantiles.
+   * @throws IllegalArgumentException if sketch is empty.
    * @see org.apache.datasketches.quantilescommon.QuantileSearchCriteria
    * @deprecated Use {@link #getRank(float, QuantileSearchCriteria)
    * getRank(quantile, searchCrit) in a loop.}
diff --git a/src/main/java/org/apache/datasketches/quantilescommon/QuantilesGenericAPI.java b/src/main/java/org/apache/datasketches/quantilescommon/QuantilesGenericAPI.java
index 9462a116..cfe0baba 100644
--- a/src/main/java/org/apache/datasketches/quantilescommon/QuantilesGenericAPI.java
+++ b/src/main/java/org/apache/datasketches/quantilescommon/QuantilesGenericAPI.java
@@ -33,6 +33,7 @@ public interface QuantilesGenericAPI<T> extends QuantilesAPI {
    * This is equivalent to {@link #getCDF(Object[], QuantileSearchCriteria) getCDF(splitPoints, INCLUSIVE)}
    * @param splitPoints an array of <i>m</i> unique, monotonically increasing items.
    * @return a discrete CDF array of m+1 double ranks (or cumulative probabilities) on the interval [0.0, 1.0].
+   * @throws IllegalArgumentException if sketch is empty.
    */
   default double[] getCDF(T[] splitPoints) {
     return getCDF(splitPoints, INCLUSIVE);
@@ -43,8 +44,6 @@ public interface QuantilesGenericAPI<T> extends QuantilesAPI {
    * as a monotonically increasing array of double ranks (or cumulative probabilities) on the interval [0.0, 1.0],
    * given a set of splitPoints.
    *
-   * <p>If the sketch is empty this returns null.</p>
-   *
    * <p>The resulting approximations have a probabilistic guarantee that can be obtained from the
    * getNormalizedRankError(false) function.</p>
    *
@@ -71,6 +70,7 @@ public interface QuantilesGenericAPI<T> extends QuantilesAPI {
    *
    * @param searchCrit the desired search criteria.
    * @return a discrete CDF array of m+1 double ranks (or cumulative probabilities) on the interval [0.0, 1.0].
+   * @throws IllegalArgumentException if sketch is empty.
    */
   double[] getCDF(T[] splitPoints, QuantileSearchCriteria searchCrit);
 
@@ -78,9 +78,8 @@ public interface QuantilesGenericAPI<T> extends QuantilesAPI {
    * Returns the maximum item of the stream. This is provided for convenience, but may be different from the largest
    * item retained by the sketch algorithm.
    *
-   * <p>If the sketch is empty this returns null.</p>
-   *
    * @return the maximum item of the stream
+   * @throws IllegalArgumentException if sketch is empty.
    */
   T getMaxItem();
 
@@ -88,9 +87,8 @@ public interface QuantilesGenericAPI<T> extends QuantilesAPI {
    * Returns the minimum item of the stream. This is provided for convenience, but is distinct from the smallest
    * item retained by the sketch algorithm.
    *
-   * <p>If the sketch is empty this returns null.</p>
-   *
    * @return the minimum item of the stream
+   * @throws IllegalArgumentException if sketch is empty.
    */
   T getMinItem();
 
@@ -98,6 +96,7 @@ public interface QuantilesGenericAPI<T> extends QuantilesAPI {
    * This is equivalent to {@link #getPMF(Object[], QuantileSearchCriteria) getPMF(splitPoints, INCLUSIVE)}
    * @param splitPoints an array of <i>m</i> unique, monotonically increasing items.
    * @return a PMF array of m+1 probability masses as doubles on the interval [0.0, 1.0].
+   * @throws IllegalArgumentException if sketch is empty.
    */
   default double[] getPMF(T[] splitPoints) {
     return getPMF(splitPoints, INCLUSIVE);
@@ -111,8 +110,6 @@ public interface QuantilesGenericAPI<T> extends QuantilesAPI {
    * <p>The resulting approximations have a probabilistic guarantee that can be obtained from the
    * getNormalizedRankError(true) function.</p>
    *
-   * <p>If the sketch is empty this returns null.</p>
-   *
    * @param splitPoints an array of <i>m</i> unique, monotonically increasing items
    * (of the same type as the input items)
    * that divide the item input domain into <i>m+1</i> consecutive, non-overlapping intervals.
@@ -143,6 +140,7 @@ public interface QuantilesGenericAPI<T> extends QuantilesAPI {
    *
    * @param searchCrit the desired search criteria.
    * @return a PMF array of m+1 probability masses as doubles on the interval [0.0, 1.0].
+   * @throws IllegalArgumentException if sketch is empty.
    */
   double[] getPMF(T[] splitPoints, QuantileSearchCriteria searchCrit);
 
@@ -150,6 +148,7 @@ public interface QuantilesGenericAPI<T> extends QuantilesAPI {
    * This is equivalent to {@link #getQuantile(double, QuantileSearchCriteria) getQuantile(rank, INCLUSIVE)}
    * @param rank the given normalized rank, a double in the range [0.0, 1.0].
    * @return the approximate quantile given the normalized rank.
+   * @throws IllegalArgumentException if sketch is empty.
    */
   default T getQuantile(double rank) {
     return getQuantile(rank, INCLUSIVE);
@@ -158,14 +157,13 @@ public interface QuantilesGenericAPI<T> extends QuantilesAPI {
   /**
    * Gets the approximate quantile of the given normalized rank and the given search criterion.
    *
-   * <p>If the sketch is empty this returns null.</p>
-   *
    * @param rank the given normalized rank, a double in the range [0.0, 1.0].
    * @param searchCrit If INCLUSIVE, the given rank includes all quantiles &le;
    * the quantile directly corresponding to the given rank.
    * If EXCLUSIVE, he given rank includes all quantiles &lt;
    * the quantile directly corresponding to the given rank.
    * @return the approximate quantile given the normalized rank.
+   * @throws IllegalArgumentException if sketch is empty.
    * @see org.apache.datasketches.quantilescommon.QuantileSearchCriteria
    */
   T getQuantile(double rank, QuantileSearchCriteria searchCrit);
@@ -174,9 +172,7 @@ public interface QuantilesGenericAPI<T> extends QuantilesAPI {
    * Gets the lower bound of the quantile confidence interval in which the quantile of the
    * given rank exists.
    *
-   * <p>If the sketch is empty this returns null.</p>
-   *
-   * <p>Although it is possible to estimate the probablity that the true quantile
+   * <p>Although it is possible to estimate the probability that the true quantile
    * exists within the quantile confidence interval specified by the upper and lower quantile bounds,
    * it is not possible to guarantee the width of the quantile confidence interval
    * as an additive or multiplicative percent of the true quantile.</p>
@@ -184,6 +180,7 @@ public interface QuantilesGenericAPI<T> extends QuantilesAPI {
    * @param rank the given normalized rank
    * @return the lower bound of the quantile confidence interval in which the quantile of the
    * given rank exists.
+   * @throws IllegalArgumentException if sketch is empty.
    */
   T getQuantileLowerBound(double rank);
 
@@ -191,9 +188,7 @@ public interface QuantilesGenericAPI<T> extends QuantilesAPI {
    * Gets the upper bound of the quantile confidence interval in which the true quantile of the
    * given rank exists.
    *
-   * <p>If the sketch is empty this returns null.</p>
-   *
-   * <p>Although it is possible to estimate the probablity that the true quantile
+   * <p>Although it is possible to estimate the probability that the true quantile
    * exists within the quantile confidence interval specified by the upper and lower quantile bounds,
    * it is not possible to guarantee the width of the quantile interval
    * as an additive or multiplicative percent of the true quantile.</p>
@@ -201,6 +196,7 @@ public interface QuantilesGenericAPI<T> extends QuantilesAPI {
    * @param rank the given normalized rank
    * @return the upper bound of the quantile confidence interval in which the true quantile of the
    * given rank exists.
+   * @throws IllegalArgumentException if sketch is empty.
    */
   T getQuantileUpperBound(double rank);
 
@@ -209,6 +205,7 @@ public interface QuantilesGenericAPI<T> extends QuantilesAPI {
    * @param ranks the given array of normalized ranks, each of which must be
    * in the interval [0.0,1.0].
    * @return an array of quantiles corresponding to the given array of normalized ranks.
+   * @throws IllegalArgumentException if sketch is empty.
    * @deprecated Use {@link #getQuantile(double, QuantileSearchCriteria)
    * getQuantile(rank, searchCrit) in a loop.}
    */
@@ -220,13 +217,12 @@ public interface QuantilesGenericAPI<T> extends QuantilesAPI {
   /**
    * Gets an array of quantiles from the given array of normalized ranks.
    *
-   * <p>If the sketch is empty this returns null.</p>
-   *
    * @param ranks the given array of normalized ranks, each of which must be
    * in the interval [0.0,1.0].
    * @param searchCrit if INCLUSIVE, the given ranks include all quantiles &le;
    * the quantile directly corresponding to each rank.
    * @return an array of quantiles corresponding to the given array of normalized ranks.
+   * @throws IllegalArgumentException if sketch is empty.
    * @see org.apache.datasketches.quantilescommon.QuantileSearchCriteria
    * @deprecated Use {@link #getQuantile(double, QuantileSearchCriteria)
    * getQuantile(rank, searchCrit) in a loop.}
@@ -236,8 +232,9 @@ public interface QuantilesGenericAPI<T> extends QuantilesAPI {
 
   /**
    * This is equivalent to {@link #getQuantiles(int, QuantileSearchCriteria) getQuantiles(numEvenlySpaced, INCLUSIVE)}
-   * @param numEvenlySpaced number of evenly spaced normalied ranks
+   * @param numEvenlySpaced number of evenly spaced normalized ranks
    * @return an array of quantiles that are evenly spaced by their ranks.
+   * @throws IllegalArgumentException if sketch is empty.
    * @deprecated Use {@link #getQuantile(double, QuantileSearchCriteria)
    * getQuantile(rank, searchCrit) in a loop.}
    */
@@ -250,8 +247,6 @@ public interface QuantilesGenericAPI<T> extends QuantilesAPI {
    * This is a version of getQuantiles() where the caller only specifies the number of of desired evenly spaced,
    * normalized ranks, and returns an array of the corresponding quantiles.
    *
-   * <p>If the sketch is empty this returns null.</p>
-   *
    * @param numEvenlySpaced an integer that specifies the number of evenly spaced normalized ranks.
    * This must be a positive integer greater than 0.
    * <ul><li>Let <i>Smallest</i> and <i>Largest</i> be the smallest and largest quantiles
@@ -267,6 +262,7 @@ public interface QuantilesGenericAPI<T> extends QuantilesAPI {
    * @param searchCrit if INCLUSIVE, the given ranks include all quantiles &le; the quantile directly corresponding to
    * each rank.
    * @return an array of quantiles that are evenly spaced by their ranks.
+   * @throws IllegalArgumentException if sketch is empty.
    * @see org.apache.datasketches.quantilescommon.QuantileSearchCriteria
    * @deprecated Use {@link #getQuantile(double, QuantileSearchCriteria)
    * getQuantile(rank, searchCrit) in a loop.}
@@ -277,7 +273,8 @@ public interface QuantilesGenericAPI<T> extends QuantilesAPI {
   /**
    * This is equivalent to {@link #getRank(Object, QuantileSearchCriteria) getRank(T quantile, INCLUSIVE)}
    * @param quantile the given quantile
-   * @return the normalized rank corresponding to the given quantile
+   * @return the normalized rank corresponding to the given quantile.
+   * @throws IllegalArgumentException if sketch is empty.
    */
   default double getRank(T quantile) {
     return getRank(quantile, INCLUSIVE);
@@ -286,11 +283,10 @@ public interface QuantilesGenericAPI<T> extends QuantilesAPI {
   /**
    * Gets the normalized rank corresponding to the given a quantile.
    *
-   * <p>If the sketch is empty this returns NaN.</p>
-   *
    * @param quantile the given quantile
    * @param searchCrit if INCLUSIVE the given quantile is included into the rank.
-   * @return the normalized rank corresponding to the given quantile
+   * @return the normalized rank corresponding to the given quantile.
+   * @throws IllegalArgumentException if sketch is empty.
    * @see org.apache.datasketches.quantilescommon.QuantileSearchCriteria
    */
   double getRank(T quantile, QuantileSearchCriteria searchCrit);
@@ -299,6 +295,7 @@ public interface QuantilesGenericAPI<T> extends QuantilesAPI {
    * This is equivalent to {@link #getRanks(Object[], QuantileSearchCriteria) getRanks(quantiles, INCLUSIVE)}
    * @param quantiles the given array of quantiles
    * @return an array of normalized ranks corresponding to the given array of quantiles.
+   * @throws IllegalArgumentException if sketch is empty.
    * @deprecated Use {@link #getRank(Object, QuantileSearchCriteria)
    * getRank(quantile, searchCrit) in a loop.}
    */
@@ -311,11 +308,10 @@ public interface QuantilesGenericAPI<T> extends QuantilesAPI {
    * Gets an array of normalized ranks corresponding to the given array of quantiles and the given
    * search criterion.
    *
-   * <p>If the sketch is empty this returns null.</p>
-   *
    * @param quantiles the given array of quantiles
    * @param searchCrit if INCLUSIVE, the given quantiles include the rank directly corresponding to each quantile.
    * @return an array of normalized ranks corresponding to the given array of quantiles.
+   * @throws IllegalArgumentException if sketch is empty.
    * @see org.apache.datasketches.quantilescommon.QuantileSearchCriteria
    * @deprecated Use {@link #getRank(Object, QuantileSearchCriteria)
    * getRank(quantile, searchCrit) in a loop.}
diff --git a/src/main/java/org/apache/datasketches/quantilescommon/QuantilesUtil.java b/src/main/java/org/apache/datasketches/quantilescommon/QuantilesUtil.java
index 92d2dfba..8900ebcd 100644
--- a/src/main/java/org/apache/datasketches/quantilescommon/QuantilesUtil.java
+++ b/src/main/java/org/apache/datasketches/quantilescommon/QuantilesUtil.java
@@ -36,6 +36,8 @@ public final class QuantilesUtil {
 
   private QuantilesUtil() {}
 
+  public static final String THROWS_EMPTY = "The sketch must not be empty at this point.";
+
   /**
    * Checks that the given normalized rank: <i>0 &le; nRank &le; 1.0</i>.
    * @param nRank the given normalized rank.
diff --git a/src/main/java/org/apache/datasketches/quantilescommon/SortedView.java b/src/main/java/org/apache/datasketches/quantilescommon/SortedView.java
index d8c39a14..434b548a 100644
--- a/src/main/java/org/apache/datasketches/quantilescommon/SortedView.java
+++ b/src/main/java/org/apache/datasketches/quantilescommon/SortedView.java
@@ -39,16 +39,23 @@ package org.apache.datasketches.quantilescommon;
  */
 public interface SortedView {
 
+  /**
+   * Returns the array of cumulative weights
+   * @return the array of cumulative weights
+   */
+  long[] getCumulativeWeights();
+
+  /**
+   * Returns true if this sorted view is empty.
+   * @return true if this sorted view is empty.
+   */
+  boolean isEmpty();
+
   /**
    * Returns an iterator for this Sorted View.
    * @return an iterator for this Sorted View.
    */
   SortedViewIterator iterator();
 
-  /**
-   * Returns the array of cumulative weights
-   * @return the array of cumulative weights
-   */
-  long[] getCumulativeWeights();
 }
 
diff --git a/src/main/java/org/apache/datasketches/req/BaseReqSketch.java b/src/main/java/org/apache/datasketches/req/BaseReqSketch.java
index 5e1d4093..9aa7990b 100644
--- a/src/main/java/org/apache/datasketches/req/BaseReqSketch.java
+++ b/src/main/java/org/apache/datasketches/req/BaseReqSketch.java
@@ -19,6 +19,8 @@
 
 package org.apache.datasketches.req;
 
+import static org.apache.datasketches.quantilescommon.QuantilesUtil.THROWS_EMPTY;
+
 import org.apache.datasketches.quantilescommon.FloatsSortedView;
 import org.apache.datasketches.quantilescommon.QuantileSearchCriteria;
 import org.apache.datasketches.quantilescommon.QuantilesFloatsAPI;
@@ -90,7 +92,7 @@ abstract class BaseReqSketch implements QuantilesFloatsAPI {
   @Deprecated
   @Override
   public float[] getQuantiles(final int numEvenlySpaced, final QuantileSearchCriteria searchCrit) {
-    if (isEmpty()) { return null; }
+    if (isEmpty()) { throw new IllegalArgumentException(THROWS_EMPTY); }
     return getQuantiles(org.apache.datasketches.quantilescommon.QuantilesUtil.evenlySpaced(0.0, 1.0, numEvenlySpaced),
         searchCrit);
   }
diff --git a/src/main/java/org/apache/datasketches/req/ReqSketch.java b/src/main/java/org/apache/datasketches/req/ReqSketch.java
index da2a77d8..0baa41d0 100644
--- a/src/main/java/org/apache/datasketches/req/ReqSketch.java
+++ b/src/main/java/org/apache/datasketches/req/ReqSketch.java
@@ -20,6 +20,7 @@
 package org.apache.datasketches.req;
 
 import static org.apache.datasketches.quantilescommon.QuantileSearchCriteria.INCLUSIVE;
+import static org.apache.datasketches.quantilescommon.QuantilesUtil.THROWS_EMPTY;
 
 import java.util.ArrayList;
 import java.util.List;
@@ -202,7 +203,7 @@ public class ReqSketch extends BaseReqSketch {
 
   @Override
   public double[] getCDF(final float[] splitPoints, final QuantileSearchCriteria searchCrit) {
-    if (isEmpty()) { return null; }
+    if (isEmpty()) { throw new IllegalArgumentException(THROWS_EMPTY); }
     refreshSortedView();
     return reqSV.getCDF(splitPoints, searchCrit);
   }
@@ -214,11 +215,13 @@ public class ReqSketch extends BaseReqSketch {
 
   @Override
   public float getMaxItem() {
+    if (isEmpty()) { throw new IllegalArgumentException(THROWS_EMPTY); }
     return maxItem;
   }
 
   @Override
   public float getMinItem() {
+    if (isEmpty()) { throw new IllegalArgumentException(THROWS_EMPTY); }
     return minItem;
   }
 
@@ -229,14 +232,14 @@ public class ReqSketch extends BaseReqSketch {
 
   @Override
   public double[] getPMF(final float[] splitPoints, final QuantileSearchCriteria searchCrit) {
-    if (this.isEmpty()) { return null; }
+    if (isEmpty()) { throw new IllegalArgumentException(THROWS_EMPTY); }
     refreshSortedView();
     return reqSV.getPMF(splitPoints, searchCrit);
   }
 
   @Override
   public float getQuantile(final double normRank, final QuantileSearchCriteria searchCrit) {
-    if (isEmpty()) { return Float.NaN; }
+    if (isEmpty()) { throw new IllegalArgumentException(THROWS_EMPTY); }
     if (normRank < 0 || normRank > 1.0) {
       throw new SketchesArgumentException(
         "Normalized rank must be in the range [0.0, 1.0]: " + normRank);
@@ -248,7 +251,7 @@ public class ReqSketch extends BaseReqSketch {
   @Deprecated
   @Override
   public float[] getQuantiles(final double[] normRanks, final QuantileSearchCriteria searchCrit) {
-    if (this.isEmpty()) { return null; }
+    if (isEmpty()) { throw new IllegalArgumentException(THROWS_EMPTY); }
     refreshSortedView();
     final int len = normRanks.length;
     final float[] qArr = new float[len];
@@ -290,7 +293,7 @@ public class ReqSketch extends BaseReqSketch {
 
   @Override
   public double getRank(final float quantile, final QuantileSearchCriteria searchCrit) {
-    if (this.isEmpty()) { return Double.NaN; }
+    if (isEmpty()) { throw new IllegalArgumentException(THROWS_EMPTY); }
     refreshSortedView();
     return reqSV.getRank(quantile, searchCrit);
   }
@@ -313,7 +316,7 @@ public class ReqSketch extends BaseReqSketch {
   @Deprecated
   @Override
   public double[] getRanks(final float[] quantiles, final QuantileSearchCriteria searchCrit) {
-    if (isEmpty()) { return null; }
+    if (isEmpty()) { throw new IllegalArgumentException(THROWS_EMPTY); }
     refreshSortedView();
     final int numQuantiles = quantiles.length;
     final double[] retArr = new double[numQuantiles];
diff --git a/src/main/java/org/apache/datasketches/req/ReqSketchSortedView.java b/src/main/java/org/apache/datasketches/req/ReqSketchSortedView.java
index 99914f5c..a4cc8797 100644
--- a/src/main/java/org/apache/datasketches/req/ReqSketchSortedView.java
+++ b/src/main/java/org/apache/datasketches/req/ReqSketchSortedView.java
@@ -20,6 +20,7 @@
 package org.apache.datasketches.req;
 
 import static org.apache.datasketches.quantilescommon.QuantileSearchCriteria.INCLUSIVE;
+import static org.apache.datasketches.quantilescommon.QuantilesUtil.THROWS_EMPTY;
 
 import java.util.List;
 
@@ -61,6 +62,7 @@ public class ReqSketchSortedView implements FloatsSortedView {
 
   @Override
   public float getQuantile(final double rank, final QuantileSearchCriteria searchCrit) {
+    if (isEmpty()) { throw new IllegalArgumentException(THROWS_EMPTY); }
     QuantilesUtil.checkNormalizedRankBounds(rank);
     final int len = cumWeights.length;
     final long naturalRank = (searchCrit == INCLUSIVE)
@@ -75,6 +77,7 @@ public class ReqSketchSortedView implements FloatsSortedView {
 
   @Override
   public double getRank(final float quantile, final QuantileSearchCriteria searchCrit) {
+    if (isEmpty()) { throw new IllegalArgumentException(THROWS_EMPTY); }
     final int len = quantiles.length;
     final InequalitySearch crit = (searchCrit == INCLUSIVE) ? InequalitySearch.LE : InequalitySearch.LT;
     final int index = InequalitySearch.find(quantiles,  0, len - 1, quantile, crit);
@@ -94,6 +97,11 @@ public class ReqSketchSortedView implements FloatsSortedView {
     return quantiles.clone();
   }
 
+  @Override
+  public boolean isEmpty() {
+    return totalN == 0;
+  }
+
   @Override
   public ReqSketchSortedViewIterator iterator() {
     return new ReqSketchSortedViewIterator(quantiles, cumWeights);
@@ -105,7 +113,7 @@ public class ReqSketchSortedView implements FloatsSortedView {
     final List<ReqCompactor> compactors = sk.getCompactors();
     final int numComp = compactors.size();
     final int totalQuantiles = sk.getNumRetained();
-    quantiles = new float[totalQuantiles];
+    quantiles = new float[totalQuantiles]; //could have zero entries
     cumWeights = new long[totalQuantiles];
     int count = 0;
     for (int i = 0; i < numComp; i++) {
diff --git a/src/main/java/org/apache/datasketches/thetacommon/SetOperationCornerCases.java b/src/main/java/org/apache/datasketches/thetacommon/SetOperationCornerCases.java
index cad7ea41..0a6bd8bf 100644
--- a/src/main/java/org/apache/datasketches/thetacommon/SetOperationCornerCases.java
+++ b/src/main/java/org/apache/datasketches/thetacommon/SetOperationCornerCases.java
@@ -28,7 +28,6 @@ import org.apache.datasketches.common.SketchesArgumentException;
  * Simplifies and speeds up set operations by resolving specific corner cases.
  * @author Lee Rhodes
  */
-@SuppressWarnings("javadoc")
 public class SetOperationCornerCases {
   private static final long MAX = Long.MAX_VALUE;
 
diff --git a/src/main/java/org/apache/datasketches/tuple/SerializerDeserializer.java b/src/main/java/org/apache/datasketches/tuple/SerializerDeserializer.java
index 44d1d9cc..e4e60366 100644
--- a/src/main/java/org/apache/datasketches/tuple/SerializerDeserializer.java
+++ b/src/main/java/org/apache/datasketches/tuple/SerializerDeserializer.java
@@ -31,7 +31,6 @@ public final class SerializerDeserializer {
   /**
    * Defines the sketch classes that this SerializerDeserializer can handle.
    */
-  @SuppressWarnings("javadoc")
   public static enum SketchType { QuickSelectSketch, CompactSketch, ArrayOfDoublesQuickSelectSketch,
     ArrayOfDoublesCompactSketch, ArrayOfDoublesUnion }
 
diff --git a/src/main/java/org/apache/datasketches/tuple/Util.java b/src/main/java/org/apache/datasketches/tuple/Util.java
index a3b6ca15..4a53b4ba 100644
--- a/src/main/java/org/apache/datasketches/tuple/Util.java
+++ b/src/main/java/org/apache/datasketches/tuple/Util.java
@@ -153,7 +153,7 @@ public final class Util {
     return tmpSummaryArr;
   }
 
-  @SuppressWarnings({"unchecked", "javadoc"})
+  @SuppressWarnings("unchecked")
   public static <S extends Summary> S[] newSummaryArray(final S[] summaryArr, final int length) {
     final Class<S> summaryType = (Class<S>) summaryArr.getClass().getComponentType();
     final S[] tmpSummaryArr = (S[]) Array.newInstance(summaryType, length);
diff --git a/src/test/java/org/apache/datasketches/kll/KllDirectCompactDoublesSketchTest.java b/src/test/java/org/apache/datasketches/kll/KllDirectCompactDoublesSketchTest.java
index 41e11aaf..463c32c9 100644
--- a/src/test/java/org/apache/datasketches/kll/KllDirectCompactDoublesSketchTest.java
+++ b/src/test/java/org/apache/datasketches/kll/KllDirectCompactDoublesSketchTest.java
@@ -20,7 +20,6 @@
 package org.apache.datasketches.kll;
 
 import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertTrue;
 import static org.testng.Assert.fail;
 
 import org.apache.datasketches.common.SketchesArgumentException;
@@ -106,8 +105,8 @@ public class KllDirectCompactDoublesSketchTest {
     int k = 20;
     KllDoublesSketch sk = KllDoublesSketch.newHeapInstance(k);
     KllDoublesSketch sk2 = KllDoublesSketch.wrap(Memory.wrap(sk.toByteArray()));
-    assertTrue(Double.isNaN(sk2.getMaxItem()));
-    assertTrue(Double.isNaN(sk2.getMinItem()));
+    try { sk2.getMinItem(); fail(); } catch (IllegalArgumentException e) {}
+    try { sk2.getMaxItem(); fail(); } catch (IllegalArgumentException e) {}
     sk.update(1);
     sk2 = KllDoublesSketch.wrap(Memory.wrap(sk.toByteArray()));
     assertEquals(sk2.getMaxItem(),1.0F);
diff --git a/src/test/java/org/apache/datasketches/kll/KllDirectCompactFloatsSketchTest.java b/src/test/java/org/apache/datasketches/kll/KllDirectCompactFloatsSketchTest.java
index ca63ca1f..102344e8 100644
--- a/src/test/java/org/apache/datasketches/kll/KllDirectCompactFloatsSketchTest.java
+++ b/src/test/java/org/apache/datasketches/kll/KllDirectCompactFloatsSketchTest.java
@@ -20,7 +20,6 @@
 package org.apache.datasketches.kll;
 
 import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertTrue;
 import static org.testng.Assert.fail;
 
 import org.apache.datasketches.common.SketchesArgumentException;
@@ -106,8 +105,8 @@ public class KllDirectCompactFloatsSketchTest {
     int k = 20;
     KllFloatsSketch sk = KllFloatsSketch.newHeapInstance(k);
     KllFloatsSketch sk2 = KllFloatsSketch.wrap(Memory.wrap(sk.toByteArray()));
-    assertTrue(Float.isNaN(sk2.getMaxItem()));
-    assertTrue(Float.isNaN(sk2.getMinItem()));
+    try { sk2.getMinItem(); fail(); } catch (IllegalArgumentException e) {}
+    try { sk2.getMaxItem(); fail(); } catch (IllegalArgumentException e) {}
     sk.update(1);
     sk2 = KllFloatsSketch.wrap(Memory.wrap(sk.toByteArray()));
     assertEquals(sk2.getMaxItem(),1.0F);
diff --git a/src/test/java/org/apache/datasketches/kll/KllDirectDoublesSketchTest.java b/src/test/java/org/apache/datasketches/kll/KllDirectDoublesSketchTest.java
index dcadef48..0a10b001 100644
--- a/src/test/java/org/apache/datasketches/kll/KllDirectDoublesSketchTest.java
+++ b/src/test/java/org/apache/datasketches/kll/KllDirectDoublesSketchTest.java
@@ -19,11 +19,10 @@
 
 package org.apache.datasketches.kll;
 
-import static org.apache.datasketches.quantilescommon.QuantileSearchCriteria.*;
+import static org.apache.datasketches.quantilescommon.QuantileSearchCriteria.EXCLUSIVE;
 import static org.testng.Assert.assertEquals;
 import static org.testng.Assert.assertFalse;
 import static org.testng.Assert.assertNotNull;
-import static org.testng.Assert.assertNull;
 import static org.testng.Assert.assertTrue;
 import static org.testng.Assert.fail;
 
@@ -49,12 +48,12 @@ public class KllDirectDoublesSketchTest {
     assertTrue(sketch.isEmpty());
     assertEquals(sketch.getN(), 0);
     assertEquals(sketch.getNumRetained(), 0);
-    assertTrue(Double.isNaN(sketch.getRank(0)));
-    assertTrue(Double.isNaN(sketch.getMinItem()));
-    assertTrue(Double.isNaN(sketch.getMaxItem()));
-    assertTrue(Double.isNaN(sketch.getQuantile(0.5)));
-    assertNull(sketch.getQuantiles(new double[] {0}));
-    assertNull(sketch.getPMF(new double[] {0}));
+    try { sketch.getRank(0); fail(); } catch (IllegalArgumentException e) {}
+    try { sketch.getMinItem(); fail(); } catch (IllegalArgumentException e) {}
+    try { sketch.getMaxItem(); fail(); } catch (IllegalArgumentException e) {}
+    try { sketch.getQuantile(0.5); fail(); } catch (IllegalArgumentException e) {}
+    try { sketch.getQuantiles(new double[] {0}); fail(); } catch (IllegalArgumentException e) {}
+    try { sketch.getPMF(new double[] {0}); fail(); } catch (IllegalArgumentException e) {}
     assertNotNull(sketch.toString(true, true));
     assertNotNull(sketch.toString());
   }
@@ -319,8 +318,8 @@ public class KllDirectDoublesSketchTest {
     assertEquals(sketch2.getNumRetained(), sketch1.getNumRetained());
     assertEquals(sketch2.getN(), sketch1.getN());
     assertEquals(sketch2.getNormalizedRankError(false), sketch1.getNormalizedRankError(false));
-    assertTrue(Double.isNaN(sketch2.getMinItem()));
-    assertTrue(Double.isNaN(sketch2.getMaxItem()));
+    try { sketch2.getMinItem(); fail(); } catch (IllegalArgumentException e) {}
+    try { sketch2.getMaxItem(); fail(); } catch (IllegalArgumentException e) {}
     assertEquals(sketch2.getCurrentCompactSerializedSizeBytes(), sketch1.getCurrentCompactSerializedSizeBytes());
   }
 
@@ -335,8 +334,8 @@ public class KllDirectDoublesSketchTest {
     assertEquals(sketch2.getNumRetained(), sketch1.getNumRetained());
     assertEquals(sketch2.getN(), sketch1.getN());
     assertEquals(sketch2.getNormalizedRankError(false), sketch1.getNormalizedRankError(false));
-    assertTrue(Double.isNaN(sketch2.getMinItem()));
-    assertTrue(Double.isNaN(sketch2.getMaxItem()));
+    try { sketch2.getMinItem(); fail(); } catch (IllegalArgumentException e) {}
+    try { sketch2.getMaxItem(); fail(); } catch (IllegalArgumentException e) {}
     assertEquals(sketch2.getCurrentCompactSerializedSizeBytes(), sketch1.getCurrentCompactSerializedSizeBytes());
   }
 
diff --git a/src/test/java/org/apache/datasketches/kll/KllDirectFloatsSketchTest.java b/src/test/java/org/apache/datasketches/kll/KllDirectFloatsSketchTest.java
index 03da556c..81407776 100644
--- a/src/test/java/org/apache/datasketches/kll/KllDirectFloatsSketchTest.java
+++ b/src/test/java/org/apache/datasketches/kll/KllDirectFloatsSketchTest.java
@@ -23,7 +23,6 @@ import static org.apache.datasketches.quantilescommon.QuantileSearchCriteria.EXC
 import static org.testng.Assert.assertEquals;
 import static org.testng.Assert.assertFalse;
 import static org.testng.Assert.assertNotNull;
-import static org.testng.Assert.assertNull;
 import static org.testng.Assert.assertTrue;
 import static org.testng.Assert.fail;
 
@@ -49,12 +48,13 @@ public class KllDirectFloatsSketchTest {
     assertTrue(sketch.isEmpty());
     assertEquals(sketch.getN(), 0);
     assertEquals(sketch.getNumRetained(), 0);
-    assertTrue(Double.isNaN(sketch.getRank(0)));
-    assertTrue(Float.isNaN(sketch.getMinItem()));
-    assertTrue(Float.isNaN(sketch.getMaxItem()));
-    assertTrue(Float.isNaN(sketch.getQuantile(0.5)));
-    assertNull(sketch.getQuantiles(new double[] {0}));
-    assertNull(sketch.getPMF(new float[] {0}));
+    try { sketch.getRank(0.5f); fail(); } catch (IllegalArgumentException e) {}
+    try { sketch.getMinItem(); fail(); } catch (IllegalArgumentException e) {}
+    try { sketch.getMaxItem(); fail(); } catch (IllegalArgumentException e) {}
+    try { sketch.getQuantile(0.5); fail(); } catch (IllegalArgumentException e) {}
+    try { sketch.getQuantiles(new double[] {0.0, 1.0}); fail(); } catch (IllegalArgumentException e) {}
+    try { sketch.getPMF(new float[0]); fail(); } catch (IllegalArgumentException e) {}
+    try { sketch.getCDF(new float[0]); fail(); } catch (IllegalArgumentException e) {}
     assertNotNull(sketch.toString(true, true));
     assertNotNull(sketch.toString());
   }
@@ -112,17 +112,17 @@ public class KllDirectFloatsSketchTest {
     assertEquals(sketch.getMaxItem(), n - 1f); // max value is exact
 
     // check at every 0.1 percentage point
-    final double[] fractions = new double[1001];
-    final double[] reverseFractions = new double[1001]; // check that ordering doesn't matter
+    final double[] ranks = new double[1001];
+    final double[] reverseRanks = new double[1001]; // check that ordering doesn't matter
     for (int i = 0; i <= 1000; i++) {
-      fractions[i] = (double) i / 1000;
-      reverseFractions[1000 - i] = fractions[i];
+      ranks[i] = (double) i / 1000;
+      reverseRanks[1000 - i] = ranks[i];
     }
-    final float[] quantiles = sketch.getQuantiles(fractions);
-    final float[] reverseQuantiles = sketch.getQuantiles(reverseFractions);
-    double previousQuantile = 0;
+    final float[] quantiles = sketch.getQuantiles(ranks);
+    final float[] reverseQuantiles = sketch.getQuantiles(reverseRanks);
+    float previousQuantile = 0f;
     for (int i = 0; i <= 1000; i++) {
-      final double quantile = sketch.getQuantile(fractions[i]);
+      final float quantile = sketch.getQuantile(ranks[i]);
       assertEquals(quantile, quantiles[i]);
       assertEquals(quantile, reverseQuantiles[1000 - i]);
       assertTrue(previousQuantile <= quantile);
@@ -318,8 +318,8 @@ public class KllDirectFloatsSketchTest {
     assertEquals(sketch2.getNumRetained(), sketch1.getNumRetained());
     assertEquals(sketch2.getN(), sketch1.getN());
     assertEquals(sketch2.getNormalizedRankError(false), sketch1.getNormalizedRankError(false));
-    assertTrue(Double.isNaN(sketch2.getMinItem()));
-    assertTrue(Double.isNaN(sketch2.getMaxItem()));
+    try { sketch2.getMinItem(); fail(); } catch (IllegalArgumentException e) {}
+    try { sketch2.getMaxItem(); fail(); } catch (IllegalArgumentException e) {}
     assertEquals(sketch2.getCurrentCompactSerializedSizeBytes(), sketch1.getCurrentCompactSerializedSizeBytes());
   }
 
@@ -334,8 +334,8 @@ public class KllDirectFloatsSketchTest {
     assertEquals(sketch2.getNumRetained(), sketch1.getNumRetained());
     assertEquals(sketch2.getN(), sketch1.getN());
     assertEquals(sketch2.getNormalizedRankError(false), sketch1.getNormalizedRankError(false));
-    assertTrue(Double.isNaN(sketch2.getMinItem()));
-    assertTrue(Double.isNaN(sketch2.getMaxItem()));
+    try { sketch2.getMinItem(); fail(); } catch (IllegalArgumentException e) {}
+    try { sketch2.getMaxItem(); fail(); } catch (IllegalArgumentException e) {}
     assertEquals(sketch2.getCurrentCompactSerializedSizeBytes(), sketch1.getCurrentCompactSerializedSizeBytes());
   }
 
@@ -350,8 +350,9 @@ public class KllDirectFloatsSketchTest {
     assertEquals(sketch2.getNumRetained(), 1);
     assertEquals(sketch2.getN(), 1);
     assertEquals(sketch2.getNormalizedRankError(false), sketch1.getNormalizedRankError(false));
-    assertFalse(Double.isNaN(sketch2.getMinItem()));
-    assertFalse(Double.isNaN(sketch2.getMaxItem()));
+    assertTrue(Float.isFinite(sketch2.getMinItem()));
+    assertTrue(Float.isFinite(sketch2.getMinItem()));
+    assertTrue(Float.isFinite(sketch2.getMaxItem()));
     assertEquals(sketch2.getCurrentCompactSerializedSizeBytes(), 8 + Float.BYTES);
   }
 
@@ -367,8 +368,8 @@ public class KllDirectFloatsSketchTest {
     assertEquals(sketch2.getNumRetained(), 1);
     assertEquals(sketch2.getN(), 1);
     assertEquals(sketch2.getNormalizedRankError(false), sketch1.getNormalizedRankError(false));
-    assertFalse(Double.isNaN(sketch2.getMinItem()));
-    assertFalse(Double.isNaN(sketch2.getMaxItem()));
+    assertTrue(Float.isFinite(sketch2.getMinItem()));
+    assertTrue(Float.isFinite(sketch2.getMaxItem()));
     assertEquals(sketch2.getCurrentCompactSerializedSizeBytes(), 8 + Float.BYTES);
   }
 
@@ -466,14 +467,14 @@ public class KllDirectFloatsSketchTest {
   }
 
   @Test
-  public void checkSketchInitializeDirectDoubleUpdatableMem() {
+  public void checkSketchInitializeDirectFloatUpdatableMem() {
     int k = 20; //don't change this
     KllFloatsSketch sk;
     KllFloatsSketch sk2;
     byte[] compBytes;
     WritableMemory wmem;
 
-    println("#### CASE: DOUBLE FULL DIRECT FROM UPDATABLE");
+    println("#### CASE: FLOAT FULL DIRECT FROM UPDATABLE");
     sk2 = KllFloatsSketch.newHeapInstance(k);
     for (int i = 1; i <= k + 1; i++) { sk2.update(i); }
     //println(sk2.toString(true, true));
@@ -494,7 +495,7 @@ public class KllDirectFloatsSketchTest {
     assertEquals(sk.getNumLevels(), 2);
     assertFalse(sk.isLevelZeroSorted());
 
-    println("#### CASE: DOUBLE EMPTY HEAPIFIED FROM UPDATABLE");
+    println("#### CASE: FLOAT EMPTY HEAPIFIED FROM UPDATABLE");
     sk2 = KllFloatsSketch.newHeapInstance(k);
     //println(sk.toString(true, true));
     compBytes = KllHelper.toUpdatableByteArrayImpl(sk2);
@@ -509,12 +510,12 @@ public class KllDirectFloatsSketchTest {
     assertEquals(sk.getMinK(), k);
     assertEquals(sk.getFloatItemsArray().length, 20);
     assertEquals(sk.getLevelsArray().length, 2);
-    assertEquals(sk.getMaxFloatItem(), Double.NaN);
-    assertEquals(sk.getMinFloatItem(), Double.NaN);
+    try { sk.getMaxItem(); fail(); } catch (IllegalArgumentException e) {}
+    try { sk.getMinItem(); fail(); } catch (IllegalArgumentException e) {}
     assertEquals(sk.getNumLevels(), 1);
     assertFalse(sk.isLevelZeroSorted());
 
-    println("#### CASE: DOUBLE SINGLE HEAPIFIED FROM UPDATABLE");
+    println("#### CASE: FLOAT SINGLE HEAPIFIED FROM UPDATABLE");
     sk2 = KllFloatsSketch.newHeapInstance(k);
     sk2.update(1);
     //println(sk.toString(true, true));
@@ -636,8 +637,8 @@ public class KllDirectFloatsSketchTest {
     try { sk2.setFloatItemsArray(fltArr);      fail(); } catch (SketchesArgumentException e) { }
     try { sk2.setFloatItemsArrayAt(idx, fltV); fail(); } catch (SketchesArgumentException e) { }
     try { sk2.setLevelZeroSorted(bool);        fail(); } catch (SketchesArgumentException e) { }
-    try { sk2.setMaxFloatItem(fltV);          fail(); } catch (SketchesArgumentException e) { }
-    try { sk2.setMinFloatItem(fltV);          fail(); } catch (SketchesArgumentException e) { }
+    try { sk2.setMaxFloatItem(fltV);           fail(); } catch (SketchesArgumentException e) { }
+    try { sk2.setMinFloatItem(fltV);           fail(); } catch (SketchesArgumentException e) { }
     try { sk2.setMinK(idx);                    fail(); } catch (SketchesArgumentException e) { }
     try { sk2.setN(idx);                       fail(); } catch (SketchesArgumentException e) { }
     try { sk2.setNumLevels(idx);               fail(); } catch (SketchesArgumentException e) { }
diff --git a/src/test/java/org/apache/datasketches/kll/KllDoublesSketchTest.java b/src/test/java/org/apache/datasketches/kll/KllDoublesSketchTest.java
index 7b1ad5b9..8c7d927d 100644
--- a/src/test/java/org/apache/datasketches/kll/KllDoublesSketchTest.java
+++ b/src/test/java/org/apache/datasketches/kll/KllDoublesSketchTest.java
@@ -24,7 +24,6 @@ import static org.apache.datasketches.quantilescommon.QuantileSearchCriteria.INC
 import static org.testng.Assert.assertEquals;
 import static org.testng.Assert.assertFalse;
 import static org.testng.Assert.assertNotNull;
-import static org.testng.Assert.assertNull;
 import static org.testng.Assert.assertTrue;
 import static org.testng.Assert.fail;
 
@@ -52,12 +51,11 @@ public class KllDoublesSketchTest {
     assertTrue(sketch.isEmpty());
     assertEquals(sketch.getN(), 0);
     assertEquals(sketch.getNumRetained(), 0);
-    assertTrue(Double.isNaN(sketch.getRank(0)));
-    assertTrue(Double.isNaN(sketch.getMinItem()));
-    assertTrue(Double.isNaN(sketch.getMaxItem()));
-    assertTrue(Double.isNaN(sketch.getQuantile(0.5)));
-    assertNull(sketch.getQuantiles(new double[] {0}));
-    assertNull(sketch.getPMF(new double[] {0}));
+    try { sketch.getMinItem(); fail(); } catch (IllegalArgumentException e) {}
+    try { sketch.getMaxItem(); fail(); } catch (IllegalArgumentException e) {}
+    try { sketch.getQuantile(0.5); fail(); } catch (IllegalArgumentException e) {}
+    try { sketch.getQuantiles(new double[] {0}); fail(); } catch (IllegalArgumentException e) {}
+    try { sketch.getPMF(new double[] {0}); fail(); } catch (IllegalArgumentException e) {}
     assertNotNull(sketch.toString(true, true));
     assertNotNull(sketch.toString());
   }
@@ -406,8 +404,8 @@ public class KllDoublesSketchTest {
     assertEquals(sketch2.getNumRetained(), sketch1.getNumRetained());
     assertEquals(sketch2.getN(), sketch1.getN());
     assertEquals(sketch2.getNormalizedRankError(false), sketch1.getNormalizedRankError(false));
-    assertTrue(Double.isNaN(sketch2.getMinItem()));
-    assertTrue(Double.isNaN(sketch2.getMaxItem()));
+    try { sketch2.getMinItem(); fail(); } catch (IllegalArgumentException e) {}
+    try { sketch2.getMaxItem(); fail(); } catch (IllegalArgumentException e) {}
     assertEquals(sketch2.getCurrentCompactSerializedSizeBytes(), sketch1.getCurrentCompactSerializedSizeBytes());
   }
 
@@ -422,8 +420,8 @@ public class KllDoublesSketchTest {
     assertEquals(sketch2.getNumRetained(), 1);
     assertEquals(sketch2.getN(), 1);
     assertEquals(sketch2.getNormalizedRankError(false), sketch1.getNormalizedRankError(false));
-    assertFalse(Double.isNaN(sketch2.getMinItem()));
-    assertFalse(Double.isNaN(sketch2.getMaxItem()));
+    assertEquals(sketch2.getMinItem(), 1.0);
+    assertEquals(sketch2.getMaxItem(), 1.0);
     assertEquals(sketch2.getCurrentCompactSerializedSizeBytes(), 8 + Double.BYTES);
   }
 
@@ -508,12 +506,12 @@ public class KllDoublesSketchTest {
     int idx = 1;
     KllDoublesSketch sk = KllDoublesSketch.newHeapInstance(20);
     try { sk.getFloatItemsArray();           fail(); } catch (SketchesArgumentException e) { }
-    try { sk.getMaxFloatItem();             fail(); } catch (SketchesArgumentException e) { }
-    try { sk.getMinFloatItem();             fail(); } catch (SketchesArgumentException e) { }
+    try { sk.getMaxFloatItem();              fail(); } catch (SketchesArgumentException e) { }
+    try { sk.getMinFloatItem();              fail(); } catch (SketchesArgumentException e) { }
     try { sk.setFloatItemsArray(fltArr);     fail(); } catch (SketchesArgumentException e) { }
     try { sk.setFloatItemsArrayAt(idx,fltV); fail(); } catch (SketchesArgumentException e) { }
-    try { sk.setMaxFloatItem(fltV);         fail(); } catch (SketchesArgumentException e) { }
-    try { sk.setMinFloatItem(fltV);         fail(); } catch (SketchesArgumentException e) { }
+    try { sk.setMaxFloatItem(fltV);          fail(); } catch (SketchesArgumentException e) { }
+    try { sk.setMinFloatItem(fltV);          fail(); } catch (SketchesArgumentException e) { }
   }
 
   @Test
diff --git a/src/test/java/org/apache/datasketches/kll/KllFloatsSketchIteratorTest.java b/src/test/java/org/apache/datasketches/kll/KllFloatsSketchIteratorTest.java
index 4c5ba9a2..eed96eba 100644
--- a/src/test/java/org/apache/datasketches/kll/KllFloatsSketchIteratorTest.java
+++ b/src/test/java/org/apache/datasketches/kll/KllFloatsSketchIteratorTest.java
@@ -42,7 +42,7 @@ public class KllFloatsSketchIteratorTest {
   public void twoItemSketchForIterator() {
     KllFloatsSketch sketch = KllFloatsSketch.newHeapInstance();
     sketch.update(1);
-    sketch.update(2);;
+    sketch.update(2);
     QuantilesFloatsSketchIterator itr = sketch.iterator();
     assertTrue(itr.next());
 
@@ -59,7 +59,7 @@ public class KllFloatsSketchIteratorTest {
   public void twoItemSketchForSortedViewIterator() {
     KllFloatsSketch sketch = KllFloatsSketch.newHeapInstance();
     sketch.update(1);
-    sketch.update(2);;
+    sketch.update(2);
     FloatsSortedViewIterator itr = sketch.getSortedView().iterator();
 
     assertTrue(itr.next());
diff --git a/src/test/java/org/apache/datasketches/kll/KllFloatsSketchTest.java b/src/test/java/org/apache/datasketches/kll/KllFloatsSketchTest.java
index 90739b89..e79e102b 100644
--- a/src/test/java/org/apache/datasketches/kll/KllFloatsSketchTest.java
+++ b/src/test/java/org/apache/datasketches/kll/KllFloatsSketchTest.java
@@ -25,7 +25,6 @@ import static org.apache.datasketches.quantilescommon.QuantileSearchCriteria.INC
 import static org.testng.Assert.assertEquals;
 import static org.testng.Assert.assertFalse;
 import static org.testng.Assert.assertNotNull;
-import static org.testng.Assert.assertNull;
 import static org.testng.Assert.assertTrue;
 import static org.testng.Assert.fail;
 
@@ -52,12 +51,13 @@ public class KllFloatsSketchTest {
     assertTrue(sketch.isEmpty());
     assertEquals(sketch.getN(), 0);
     assertEquals(sketch.getNumRetained(), 0);
-    assertTrue(Double.isNaN(sketch.getRank(0)));
-    assertTrue(Float.isNaN(sketch.getMinItem()));
-    assertTrue(Float.isNaN(sketch.getMaxItem()));
-    assertTrue(Float.isNaN(sketch.getQuantile(0.5)));
-    assertNull(sketch.getQuantiles(new double[] {0}));
-    assertNull(sketch.getPMF(new float[] {0}));
+    try { sketch.getRank(0); fail(); } catch (IllegalArgumentException e) {}
+    try { sketch.getMinItem(); fail(); } catch (IllegalArgumentException e) {}
+    try { sketch.getMaxItem(); fail(); } catch (IllegalArgumentException e) {}
+    try { sketch.getQuantile(0.5); fail(); } catch (IllegalArgumentException e) {}
+    try { sketch.getQuantiles(new double[] {0}); fail(); } catch (IllegalArgumentException e) {}
+    try { sketch.getPMF(new float[] {0}); fail(); } catch (IllegalArgumentException e) {}
+    try { sketch.getCDF(new float[] {0}); fail(); } catch (IllegalArgumentException e) {}
     assertNotNull(sketch.toString(true, true));
     assertNotNull(sketch.toString());
   }
@@ -405,8 +405,8 @@ public class KllFloatsSketchTest {
     assertEquals(sketch2.getNumRetained(), sketch1.getNumRetained());
     assertEquals(sketch2.getN(), sketch1.getN());
     assertEquals(sketch2.getNormalizedRankError(false), sketch1.getNormalizedRankError(false));
-    assertTrue(Float.isNaN(sketch2.getMinItem()));
-    assertTrue(Float.isNaN(sketch2.getMaxItem()));
+    try { sketch2.getMinItem(); fail(); } catch (IllegalArgumentException e) {}
+    try { sketch2.getMaxItem(); fail(); } catch (IllegalArgumentException e) {}
     assertEquals(sketch2.getCurrentCompactSerializedSizeBytes(), sketch1.getCurrentCompactSerializedSizeBytes());
   }
 
diff --git a/src/test/java/org/apache/datasketches/kll/KllMiscDirectDoublesTest.java b/src/test/java/org/apache/datasketches/kll/KllMiscDirectDoublesTest.java
index c55c1606..789eba7c 100644
--- a/src/test/java/org/apache/datasketches/kll/KllMiscDirectDoublesTest.java
+++ b/src/test/java/org/apache/datasketches/kll/KllMiscDirectDoublesTest.java
@@ -22,8 +22,7 @@ package org.apache.datasketches.kll;
 import static org.testng.Assert.assertEquals;
 import static org.testng.Assert.assertFalse;
 import static org.testng.Assert.assertTrue;
-
-import java.util.Objects;
+import static org.testng.Assert.fail;
 
 import org.apache.datasketches.memory.DefaultMemoryRequestServer;
 import org.apache.datasketches.memory.WritableMemory;
@@ -59,7 +58,7 @@ public class KllMiscDirectDoublesTest {
   @Test
   public void checkMisc() {
     final KllDoublesSketch sk = getDDSketch(8, 0);
-    assertTrue(Objects.isNull(sk.getQuantiles(10)));
+    try { sk.getQuantiles(10); fail(); } catch (IllegalArgumentException e) {}
     //sk.toString(true, true);
     for (int i = 0; i < 20; i++) { sk.update(i); }
     //sk.toString(true, true);
diff --git a/src/test/java/org/apache/datasketches/kll/KllMiscDirectFloatsTest.java b/src/test/java/org/apache/datasketches/kll/KllMiscDirectFloatsTest.java
index dabbf62c..582600a2 100644
--- a/src/test/java/org/apache/datasketches/kll/KllMiscDirectFloatsTest.java
+++ b/src/test/java/org/apache/datasketches/kll/KllMiscDirectFloatsTest.java
@@ -22,8 +22,7 @@ package org.apache.datasketches.kll;
 import static org.testng.Assert.assertEquals;
 import static org.testng.Assert.assertFalse;
 import static org.testng.Assert.assertTrue;
-
-import java.util.Objects;
+import static org.testng.Assert.fail;
 
 import org.apache.datasketches.memory.DefaultMemoryRequestServer;
 import org.apache.datasketches.memory.WritableMemory;
@@ -59,7 +58,8 @@ public class KllMiscDirectFloatsTest {
   @Test
   public void checkMisc() {
     final KllFloatsSketch sk = getDFSketch(8, 0);
-    assertTrue(Objects.isNull(sk.getQuantiles(10)));
+    try { sk.getQuantiles(10); fail(); } catch (IllegalArgumentException e) {}
+
     //sk.toString(true, true);
     for (int i = 0; i < 20; i++) { sk.update(i); }
     //sk.toString(true, true);
diff --git a/src/test/java/org/apache/datasketches/kll/KllMiscDoublesTest.java b/src/test/java/org/apache/datasketches/kll/KllMiscDoublesTest.java
index 26b698cf..77491614 100644
--- a/src/test/java/org/apache/datasketches/kll/KllMiscDoublesTest.java
+++ b/src/test/java/org/apache/datasketches/kll/KllMiscDoublesTest.java
@@ -24,8 +24,6 @@ import static org.testng.Assert.assertFalse;
 import static org.testng.Assert.assertTrue;
 import static org.testng.Assert.fail;
 
-import java.util.Objects;
-
 import org.apache.datasketches.common.SketchesArgumentException;
 import org.apache.datasketches.memory.DefaultMemoryRequestServer;
 import org.apache.datasketches.memory.Memory;
@@ -108,7 +106,7 @@ public class KllMiscDoublesTest {
   @Test
   public void checkMisc() {
     KllDoublesSketch sk = KllDoublesSketch.newHeapInstance(8);
-    assertTrue(Objects.isNull(sk.getQuantiles(10)));
+    try { sk.getQuantiles(10); fail(); } catch (IllegalArgumentException e) {}
     sk.toString(true, true);
     for (int i = 0; i < 20; i++) { sk.update(i); }
     sk.toString(true, true);
diff --git a/src/test/java/org/apache/datasketches/kll/KllMiscFloatsTest.java b/src/test/java/org/apache/datasketches/kll/KllMiscFloatsTest.java
index fdafda3e..6e81d060 100644
--- a/src/test/java/org/apache/datasketches/kll/KllMiscFloatsTest.java
+++ b/src/test/java/org/apache/datasketches/kll/KllMiscFloatsTest.java
@@ -24,8 +24,6 @@ import static org.testng.Assert.assertFalse;
 import static org.testng.Assert.assertTrue;
 import static org.testng.Assert.fail;
 
-import java.util.Objects;
-
 import org.apache.datasketches.common.SketchesArgumentException;
 import org.apache.datasketches.memory.DefaultMemoryRequestServer;
 import org.apache.datasketches.memory.Memory;
@@ -38,7 +36,6 @@ import org.testng.annotations.Test;
 /**
  * @author Lee Rhodes
  */
-@SuppressWarnings("javadoc")
 public class KllMiscFloatsTest {
   static final String LS = System.getProperty("line.separator");
   private final MemoryRequestServer memReqSvr = new DefaultMemoryRequestServer();
@@ -134,7 +131,7 @@ public class KllMiscFloatsTest {
   @Test
   public void checkMisc() {
     KllFloatsSketch sk = KllFloatsSketch.newHeapInstance(8);
-    assertTrue(Objects.isNull(sk.getQuantiles(10)));
+    try { sk.getQuantiles(10); fail(); } catch (IllegalArgumentException e) {}
     sk.toString(true, true);
     for (int i = 0; i < 20; i++) { sk.update(i); }
     sk.toString(true, true);
diff --git a/src/test/java/org/apache/datasketches/quantiles/DirectCompactDoublesSketchTest.java b/src/test/java/org/apache/datasketches/quantiles/DirectCompactDoublesSketchTest.java
index a94be128..a96a3198 100644
--- a/src/test/java/org/apache/datasketches/quantiles/DirectCompactDoublesSketchTest.java
+++ b/src/test/java/org/apache/datasketches/quantiles/DirectCompactDoublesSketchTest.java
@@ -22,18 +22,17 @@ package org.apache.datasketches.quantiles;
 import static org.apache.datasketches.quantiles.ClassicUtil.LS;
 import static org.testng.Assert.assertEquals;
 import static org.testng.Assert.assertNotEquals;
-import static org.testng.Assert.assertNull;
 import static org.testng.Assert.assertTrue;
 import static org.testng.Assert.fail;
 
 import java.nio.ByteBuffer;
 import java.nio.ByteOrder;
 
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Test;
 import org.apache.datasketches.common.SketchesArgumentException;
 import org.apache.datasketches.memory.Memory;
 import org.apache.datasketches.memory.WritableMemory;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
 
 public class DirectCompactDoublesSketchTest {
 
@@ -101,8 +100,8 @@ public class DirectCompactDoublesSketchTest {
     final DoublesSketch s2 = DoublesSketch.wrap(mem);
     assertTrue(s2.isEmpty());
     assertEquals(s2.getN(), 0);
-    assertTrue(Double.isNaN(s2.getMinItem()));
-    assertTrue(Double.isNaN(s2.getMaxItem()));
+    assertTrue(Double.isNaN(s2.isEmpty() ? Double.NaN : s2.getMinItem()));
+    assertTrue(Double.isNaN(s2.isEmpty() ? Double.NaN : s2.getMaxItem()));
   }
 
   @SuppressWarnings("deprecation")
@@ -110,12 +109,8 @@ public class DirectCompactDoublesSketchTest {
   public void checkEmpty() {
     final int k = PreambleUtil.DEFAULT_K;
     final DirectCompactDoublesSketch qs1 = buildAndLoadDCQS(k, 0);
-    assertTrue(Double.isNaN(qs1.getQuantile(0.0)));
-    assertTrue(Double.isNaN(qs1.getQuantile(1.0)));
-    assertTrue(Double.isNaN(qs1.getQuantile(0.5)));
-    final double[] quantiles = qs1.getQuantiles(new double[] {0.0, 0.5, 1.0});
-    assertNull(quantiles);
-
+    try { qs1.getQuantile(0.5); fail(); } catch (IllegalArgumentException e) {}
+    try { qs1.getQuantiles(new double[] {0.0, 0.5, 1.0}); fail(); } catch (IllegalArgumentException e) {}
     final double[] combinedBuffer = qs1.getCombinedBuffer();
     assertEquals(combinedBuffer.length, 2 * k);
     assertNotEquals(combinedBuffer.length, qs1.getCombinedBufferItemCapacity());
diff --git a/src/test/java/org/apache/datasketches/quantiles/DirectUpdateDoublesSketchTest.java b/src/test/java/org/apache/datasketches/quantiles/DirectUpdateDoublesSketchTest.java
index 5ea7c985..6335a844 100644
--- a/src/test/java/org/apache/datasketches/quantiles/DirectUpdateDoublesSketchTest.java
+++ b/src/test/java/org/apache/datasketches/quantiles/DirectUpdateDoublesSketchTest.java
@@ -29,12 +29,11 @@ import static org.testng.Assert.fail;
 import java.nio.ByteBuffer;
 import java.nio.ByteOrder;
 
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Test;
 import org.apache.datasketches.common.SketchesArgumentException;
 import org.apache.datasketches.memory.WritableMemory;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
 
-@SuppressWarnings("javadoc")
 public class DirectUpdateDoublesSketchTest {
 
 
@@ -109,8 +108,8 @@ public class DirectUpdateDoublesSketchTest {
     assertTrue(s2.isEmpty());
 
     assertEquals(s2.getN(), 0);
-    assertTrue(Double.isNaN(s2.getMinItem()));
-    assertTrue(Double.isNaN(s2.getMaxItem()));
+    assertTrue(Double.isNaN(s2.isEmpty() ? Double.NaN : s2.getMinItem()));
+    assertTrue(Double.isNaN(s2.isEmpty() ? Double.NaN : s2.getMaxItem()));
 
     s2.reset(); // empty: so should be a no-op
     assertEquals(s2.getN(), 0);
diff --git a/src/test/java/org/apache/datasketches/quantiles/DoublesSketchTest.java b/src/test/java/org/apache/datasketches/quantiles/DoublesSketchTest.java
index 8ec2245c..c9dae23d 100644
--- a/src/test/java/org/apache/datasketches/quantiles/DoublesSketchTest.java
+++ b/src/test/java/org/apache/datasketches/quantiles/DoublesSketchTest.java
@@ -22,8 +22,8 @@ package org.apache.datasketches.quantiles;
 import static org.apache.datasketches.quantilescommon.QuantileSearchCriteria.INCLUSIVE;
 import static org.testng.Assert.assertEquals;
 import static org.testng.Assert.assertFalse;
-import static org.testng.Assert.assertNull;
 import static org.testng.Assert.assertTrue;
+import static org.testng.Assert.fail;
 
 import java.nio.ByteOrder;
 
@@ -35,7 +35,6 @@ import org.apache.datasketches.quantilescommon.DoublesSortedViewIterator;
 import org.testng.Assert;
 import org.testng.annotations.Test;
 
-@SuppressWarnings("javadoc")
 public class DoublesSketchTest {
 
   @Test
@@ -133,9 +132,12 @@ public class DoublesSketchTest {
   public void checkEmptyNullReturns() {
     int k = 16;
     UpdateDoublesSketch uds = DoublesSketch.builder().setK(k).build();
-    assertNull(uds.getQuantiles(5));
-    assertNull(uds.getPMF(new double[] { 0, 0.5, 1.0 }));
-    assertNull(uds.getCDF(new double[] { 0, 0.5, 1.0 }));
+    try { uds.getMaxItem(); fail(); } catch (IllegalArgumentException e) {}
+    try { uds.getMinItem(); fail(); } catch (IllegalArgumentException e) {}
+    try { uds.getRank(1.0); fail(); } catch (IllegalArgumentException e) {}
+    try { uds.getQuantiles(5); fail(); } catch (IllegalArgumentException e) {}
+    try { uds.getPMF(new double[] { 0, 0.5, 1.0 }); fail(); } catch (IllegalArgumentException e) {}
+    try { uds.getCDF(new double[] { 0, 0.5, 1.0 }); fail(); } catch (IllegalArgumentException e) {}
   }
 
   @Test
diff --git a/src/test/java/org/apache/datasketches/quantiles/HeapCompactDoublesSketchTest.java b/src/test/java/org/apache/datasketches/quantiles/HeapCompactDoublesSketchTest.java
index fc24d583..fa958b74 100644
--- a/src/test/java/org/apache/datasketches/quantiles/HeapCompactDoublesSketchTest.java
+++ b/src/test/java/org/apache/datasketches/quantiles/HeapCompactDoublesSketchTest.java
@@ -19,17 +19,18 @@
 
 package org.apache.datasketches.quantiles;
 
-import static org.apache.datasketches.quantiles.PreambleUtil.COMBINED_BUFFER;
 import static org.apache.datasketches.quantiles.ClassicUtil.LS;
+import static org.apache.datasketches.quantiles.PreambleUtil.COMBINED_BUFFER;
 import static org.testng.Assert.assertEquals;
 import static org.testng.Assert.assertNull;
 import static org.testng.Assert.assertTrue;
+import static org.testng.Assert.fail;
 
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Test;
 import org.apache.datasketches.common.SketchesArgumentException;
 import org.apache.datasketches.memory.Memory;
 import org.apache.datasketches.memory.WritableMemory;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
 
 public class HeapCompactDoublesSketchTest {
 
@@ -114,12 +115,9 @@ public class HeapCompactDoublesSketchTest {
     assertTrue(qs2.isEmpty());
     assertEquals(byteArr.length, qs1.getSerializedSizeBytes());
     assertEquals(byteArr, byteArr2);
-    assertTrue(Double.isNaN(qs2.getQuantile(0.0)));
-    assertTrue(Double.isNaN(qs2.getQuantile(1.0)));
-    assertTrue(Double.isNaN(qs2.getQuantile(0.5)));
-    final double[] quantiles = qs2.getQuantiles(new double[] {0.0, 0.5, 1.0});
-    assertNull(quantiles);
-    //println(qs1.toString(true, true));
+    try { qs2.getQuantile(0.5); fail(); } catch (IllegalArgumentException e) { }
+    try { qs2.getQuantiles(new double[] {0.0, 0.5, 1.0}); fail(); } catch (IllegalArgumentException e) { }
+    try { qs2.getRank(0); fail(); } catch (IllegalArgumentException e) { }
   }
 
   @Test(expectedExceptions = SketchesArgumentException.class)
diff --git a/src/test/java/org/apache/datasketches/quantiles/HeapUpdateDoublesSketchTest.java b/src/test/java/org/apache/datasketches/quantiles/HeapUpdateDoublesSketchTest.java
index cb5a4e0e..2aee8d49 100644
--- a/src/test/java/org/apache/datasketches/quantiles/HeapUpdateDoublesSketchTest.java
+++ b/src/test/java/org/apache/datasketches/quantiles/HeapUpdateDoublesSketchTest.java
@@ -20,14 +20,15 @@
 package org.apache.datasketches.quantiles;
 
 import static java.lang.Math.floor;
-import static org.apache.datasketches.quantiles.HeapUpdateDoublesSketch.checkPreLongsFlagsSerVer;
-import static org.apache.datasketches.quantiles.PreambleUtil.COMPACT_FLAG_MASK;
-import static org.apache.datasketches.quantiles.PreambleUtil.EMPTY_FLAG_MASK;
 import static org.apache.datasketches.common.Util.log2;
 import static org.apache.datasketches.quantiles.ClassicUtil.LS;
 import static org.apache.datasketches.quantiles.ClassicUtil.computeCombinedBufferItemCapacity;
 import static org.apache.datasketches.quantiles.ClassicUtil.computeNumLevelsNeeded;
-import static org.apache.datasketches.quantilescommon.QuantileSearchCriteria.*;
+import static org.apache.datasketches.quantiles.HeapUpdateDoublesSketch.checkPreLongsFlagsSerVer;
+import static org.apache.datasketches.quantiles.PreambleUtil.COMPACT_FLAG_MASK;
+import static org.apache.datasketches.quantiles.PreambleUtil.EMPTY_FLAG_MASK;
+import static org.apache.datasketches.quantilescommon.QuantileSearchCriteria.EXCLUSIVE;
+import static org.apache.datasketches.quantilescommon.QuantileSearchCriteria.INCLUSIVE;
 import static org.testng.Assert.assertEquals;
 import static org.testng.Assert.assertFalse;
 import static org.testng.Assert.assertNull;
@@ -436,13 +437,9 @@ public class HeapUpdateDoublesSketchTest {
     assertTrue(qs2.isEmpty());
     final int expectedSizeBytes = 8; //COMBINED_BUFFER + ((2 * MIN_K) << 3);
     assertEquals(byteArr.length, expectedSizeBytes);
-    assertTrue(Double.isNaN(qs2.getQuantile(0.0)));
-    assertTrue(Double.isNaN(qs2.getQuantile(1.0)));
-    assertTrue(Double.isNaN(qs2.getQuantile(0.5)));
-    double[] quantiles = qs2.getQuantiles(new double[] {0.0, 0.5, 1.0});
-    assertNull(quantiles);
-    assertTrue(Double.isNaN(qs2.getRank(0)));
-    //println(qs1.toString(true, true));
+    try { qs2.getQuantile(0.5); fail(); } catch (IllegalArgumentException e) { }
+    try { qs2.getQuantiles(new double[] {0.0, 0.5, 1.0}); fail(); } catch (IllegalArgumentException e) { }
+    try { qs2.getRank(0); fail(); } catch (IllegalArgumentException e) { }
   }
 
   @Test(expectedExceptions = SketchesArgumentException.class)
@@ -567,7 +564,7 @@ public class HeapUpdateDoublesSketchTest {
     HeapUpdateDoublesSketch sketch2 = HeapUpdateDoublesSketch.newInstance(2);
     DoublesSketch downSketch;
     downSketch = sketch1.downSample(sketch1, 2, null);
-    assertTrue(sameStructurePredicate (sketch2, downSketch));
+    assertTrue(sameStructurePredicate(sketch2, downSketch));
     for (int i = 0; i < 50; i++) {
       sketch1.update (i);
       sketch2.update (i);
@@ -1034,8 +1031,7 @@ public class HeapUpdateDoublesSketchTest {
 
     final boolean b2;
     if (mq1.isEmpty()) {
-      b2 = (Double.isNaN(mq1.getMinItem())) && (Double.isNaN(mq2.getMinItem())
-        &&  Double.isNaN(mq1.getMaxItem())) && (Double.isNaN(mq2.getMaxItem()));
+      b2 = mq2.isEmpty();
     } else {
       b2 =  (mq1.getMinItem() == mq2.getMinItem()) && (mq1.getMaxItem() == mq2.getMaxItem());
     }
diff --git a/src/test/java/org/apache/datasketches/quantiles/ItemsSketchTest.java b/src/test/java/org/apache/datasketches/quantiles/ItemsSketchTest.java
index 9adb410b..a17ebebe 100644
--- a/src/test/java/org/apache/datasketches/quantiles/ItemsSketchTest.java
+++ b/src/test/java/org/apache/datasketches/quantiles/ItemsSketchTest.java
@@ -24,8 +24,8 @@ import static org.apache.datasketches.quantilescommon.QuantileSearchCriteria.INC
 import static org.testng.Assert.assertEquals;
 import static org.testng.Assert.assertFalse;
 import static org.testng.Assert.assertNotNull;
-import static org.testng.Assert.assertNull;
 import static org.testng.Assert.assertTrue;
+import static org.testng.Assert.fail;
 
 import java.util.Arrays;
 import java.util.Comparator;
@@ -43,7 +43,7 @@ import org.apache.datasketches.quantilescommon.GenericSortedViewIterator;
 import org.testng.annotations.BeforeMethod;
 import org.testng.annotations.Test;
 
-@SuppressWarnings({"javadoc","deprecation"})
+@SuppressWarnings("deprecation")
 public class ItemsSketchTest {
 
   @BeforeMethod
@@ -59,16 +59,18 @@ public class ItemsSketchTest {
     assertTrue(sketch.isEmpty());
     assertEquals(sketch.getN(), 0);
     assertEquals(sketch.getNumRetained(), 0);
-    assertNull(sketch.getMinItem());
-    assertNull(sketch.getMaxItem());
-    assertNull(sketch.getQuantile(0.5));
-    assertNull(sketch.getQuantiles(2));
-    assertNull(sketch.getQuantiles(new double[] {0.0, 1.0}));
+    try { sketch.getMinItem(); fail(); } catch (IllegalArgumentException e) {}
+    try { sketch.getMaxItem(); fail(); } catch (IllegalArgumentException e) {}
+
+    try { sketch.getQuantile(0.5); fail(); } catch (IllegalArgumentException e) {}
+    try { sketch.getQuantiles(2); fail(); } catch (IllegalArgumentException e) {}
+    try { sketch.getQuantiles(new double[] {0.0, 1.0}); fail(); } catch (IllegalArgumentException e) {}
+
     final byte[] byteArr = sketch.toByteArray(new ArrayOfStringsSerDe());
     assertEquals(byteArr.length, 8);
-    assertNull(sketch.getPMF(new String[0]));
-    assertNull(sketch.getCDF(new String[0]));
-    assertTrue(Double.isNaN(sketch.getRank("a")));
+    try { sketch.getPMF(new String[0]); fail(); } catch (IllegalArgumentException e) {}
+    try { sketch.getCDF(new String[0]); fail(); } catch (IllegalArgumentException e) {}
+    try { sketch.getRank("a"); fail(); } catch (IllegalArgumentException e) {}
   }
 
   @Test
@@ -112,9 +114,9 @@ public class ItemsSketchTest {
     assertTrue(sketch.isEmpty());
     assertEquals(sketch.getN(), 0);
     assertEquals(sketch.getNumRetained(), 0);
-    assertNull(sketch.getMinItem());
-    assertNull(sketch.getMaxItem());
-    assertNull(sketch.getQuantile(0.5));
+    try { sketch.getMinItem(); fail(); } catch (IllegalArgumentException e) {}
+    try { sketch.getMaxItem(); fail(); } catch (IllegalArgumentException e) {}
+    try { sketch.getQuantile(0.5); fail(); } catch (IllegalArgumentException e) {}
   }
 
   @Test
diff --git a/src/test/java/org/apache/datasketches/quantiles/ItemsUnionTest.java b/src/test/java/org/apache/datasketches/quantiles/ItemsUnionTest.java
index 27ab1cdd..94e2d101 100644
--- a/src/test/java/org/apache/datasketches/quantiles/ItemsUnionTest.java
+++ b/src/test/java/org/apache/datasketches/quantiles/ItemsUnionTest.java
@@ -20,15 +20,16 @@
 package org.apache.datasketches.quantiles;
 
 import static org.apache.datasketches.quantiles.PreambleUtil.DEFAULT_K;
+import static org.testng.Assert.fail;
 
 import java.util.Comparator;
 
-import org.testng.Assert;
-import org.testng.annotations.Test;
 import org.apache.datasketches.common.ArrayOfItemsSerDe;
 import org.apache.datasketches.common.ArrayOfLongsSerDe;
 import org.apache.datasketches.common.ArrayOfStringsSerDe;
 import org.apache.datasketches.memory.Memory;
+import org.testng.Assert;
+import org.testng.annotations.Test;
 
 public class ItemsUnionTest {
 
@@ -52,8 +53,8 @@ public class ItemsUnionTest {
     result = union.getResult();
     Assert.assertTrue(result.isEmpty());
     Assert.assertEquals(result.getN(), 0);
-    Assert.assertNull(result.getMinItem());
-    Assert.assertNull(result.getMaxItem());
+    try { result.getMinItem(); fail(); } catch (IllegalArgumentException e) {}
+    try { result.getMaxItem(); fail(); } catch (IllegalArgumentException e) {}
     union.union(validSk);
 
     union.reset();
@@ -62,16 +63,16 @@ public class ItemsUnionTest {
     result = union.getResult();
     Assert.assertTrue(result.isEmpty());
     Assert.assertEquals(result.getN(), 0);
-    Assert.assertNull(result.getMinItem());
-    Assert.assertNull(result.getMaxItem());
+    try { result.getMinItem(); fail(); } catch (IllegalArgumentException e) {}
+    try { result.getMaxItem(); fail(); } catch (IllegalArgumentException e) {}
 
     // internal sketch is not null again because getResult() instantiated it
     union.union(ItemsSketch.getInstance(Integer.class, Comparator.naturalOrder()));
     result = union.getResult();
     Assert.assertTrue(result.isEmpty());
     Assert.assertEquals(result.getN(), 0);
-    Assert.assertNull(result.getMinItem());
-    Assert.assertNull(result.getMaxItem());
+    try { result.getMinItem(); fail(); } catch (IllegalArgumentException e) {}
+    try { result.getMaxItem(); fail(); } catch (IllegalArgumentException e) {}
 
     union.reset();
     // internal sketch is null again
@@ -79,8 +80,8 @@ public class ItemsUnionTest {
     result = union.getResult();
     Assert.assertTrue(result.isEmpty());
     Assert.assertEquals(result.getN(), 0);
-    Assert.assertNull(result.getMinItem());
-    Assert.assertNull(result.getMaxItem());
+    try { result.getMinItem(); fail(); } catch (IllegalArgumentException e) {}
+    try { result.getMaxItem(); fail(); } catch (IllegalArgumentException e) {}
   }
 
   @Test
@@ -127,8 +128,8 @@ public class ItemsUnionTest {
     final ItemsUnion<Long> union = ItemsUnion.getInstance(Long.class, 128, Comparator.naturalOrder());
     ItemsSketch<Long> result = union.getResult();
     Assert.assertEquals(result.getN(), 0);
-    Assert.assertNull(result.getMinItem());
-    Assert.assertNull(result.getMaxItem());
+    try { result.getMinItem(); fail(); } catch (IllegalArgumentException e) { }
+    try { result.getMaxItem(); fail(); } catch (IllegalArgumentException e) { }
 
     for (int i = 1; i <= 1000; i++) { union.update((long) i); }
     result = union.getResult();
@@ -159,8 +160,8 @@ public class ItemsUnionTest {
 
     result = union.getResult();
     Assert.assertEquals(result.getN(), 0);
-    Assert.assertNull(result.getMinItem());
-    Assert.assertNull(result.getMaxItem());
+    try { result.getMinItem(); fail(); } catch (IllegalArgumentException e) { }
+    try { result.getMaxItem(); fail(); } catch (IllegalArgumentException e) { }
   }
 
   @Test
@@ -168,8 +169,8 @@ public class ItemsUnionTest {
     final ItemsUnion<Long> union = ItemsUnion.getInstance(Long.class, 512, Comparator.naturalOrder());
     ItemsSketch<Long> result = union.getResult();
     Assert.assertEquals(result.getN(), 0);
-    Assert.assertNull(result.getMinItem());
-    Assert.assertNull(result.getMaxItem());
+    try { result.getMinItem(); fail(); } catch (IllegalArgumentException e) {}
+    try { result.getMaxItem(); fail(); } catch (IllegalArgumentException e) {}
 
     for (int i = 1; i <= 10000; i++) { union.update((long) i); }
     result = union.getResult();
@@ -203,8 +204,8 @@ public class ItemsUnionTest {
 
     result = union.getResult();
     Assert.assertEquals(result.getN(), 0);
-    Assert.assertNull(result.getMinItem());
-    Assert.assertNull(result.getMaxItem());
+    try { result.getMinItem(); fail(); } catch (IllegalArgumentException e) {}
+    try { result.getMaxItem(); fail(); } catch (IllegalArgumentException e) {}
   }
 
   @Test
@@ -311,8 +312,8 @@ public class ItemsUnionTest {
     final ItemsSketch<Long> skEmpty1 = buildIS(32, 0);
     final ItemsSketch<Long> skEmpty2 = buildIS(32, 0);
     ItemsMergeImpl.mergeInto(skEmpty1, skEmpty2);
-    Assert.assertNull(skEmpty2.getMaxItem());
-    Assert.assertNull(skEmpty2.getMaxItem());
+    try { skEmpty2.getMinItem(); fail(); } catch (IllegalArgumentException e) {}
+    try { skEmpty2.getMaxItem(); fail(); } catch (IllegalArgumentException e) {}
 
     ItemsSketch<Long> skValid1, skValid2;
     int n = 64;
diff --git a/src/test/java/org/apache/datasketches/quantiles/ReadOnlyMemoryTest.java b/src/test/java/org/apache/datasketches/quantiles/ReadOnlyMemoryTest.java
index e182b046..186abe0e 100644
--- a/src/test/java/org/apache/datasketches/quantiles/ReadOnlyMemoryTest.java
+++ b/src/test/java/org/apache/datasketches/quantiles/ReadOnlyMemoryTest.java
@@ -124,14 +124,14 @@ public class ReadOnlyMemoryTest {
 
     // ensure the various put calls fail
     try {
-      s2.putMinQuantile(-1.0);
+      s2.putMinItem(-1.0);
       fail();
     } catch (final SketchesReadOnlyException e) {
       // expected
     }
 
     try {
-      s2.putMaxQuantile(1.0);
+      s2.putMaxItem(1.0);
       fail();
     } catch (final SketchesReadOnlyException e) {
       // expected
diff --git a/src/test/java/org/apache/datasketches/req/ReqSketchOtherTest.java b/src/test/java/org/apache/datasketches/req/ReqSketchOtherTest.java
index 014be11f..7f36cb37 100644
--- a/src/test/java/org/apache/datasketches/req/ReqSketchOtherTest.java
+++ b/src/test/java/org/apache/datasketches/req/ReqSketchOtherTest.java
@@ -23,10 +23,10 @@ import static org.apache.datasketches.quantilescommon.InequalitySearch.GE;
 import static org.apache.datasketches.quantilescommon.InequalitySearch.GT;
 import static org.apache.datasketches.quantilescommon.InequalitySearch.LE;
 import static org.apache.datasketches.quantilescommon.InequalitySearch.LT;
-import static org.apache.datasketches.quantilescommon.QuantileSearchCriteria.*;
+import static org.apache.datasketches.quantilescommon.QuantileSearchCriteria.EXCLUSIVE;
+import static org.apache.datasketches.quantilescommon.QuantileSearchCriteria.INCLUSIVE;
 import static org.testng.Assert.assertEquals;
 import static org.testng.Assert.assertNotNull;
-import static org.testng.Assert.assertNull;
 import static org.testng.Assert.assertTrue;
 import static org.testng.Assert.fail;
 
@@ -38,7 +38,7 @@ import org.testng.annotations.Test;
 /**
  * @author Lee Rhodes
  */
-@SuppressWarnings({"unused","javadoc"})
+@SuppressWarnings("unused")
 public class ReqSketchOtherTest {
   final ReqSketchTest reqSketchTest = new ReqSketchTest();
   static InequalitySearch critLT = LT;
@@ -177,12 +177,12 @@ public class ReqSketchOtherTest {
   public void checkEmpty() {
     final ReqSketchBuilder bldr = new ReqSketchBuilder();
     final ReqSketch sk = bldr.build();
-    assertEquals(sk.getRank(1f), Double.NaN);
-    assertNull(sk.getRanks(new float[] { 1f }));
-    assertEquals(sk.getQuantile(0.5), Float.NaN);
-    assertNull(sk.getQuantiles(new double[] {0.5}));
-    assertNull(sk.getPMF(new float[] { 1f }));
-    assertNull(sk.getCDF(new float[] { 1f }));
+    try { sk.getRank(1f); fail(); } catch (IllegalArgumentException e) {}
+    try { sk.getRanks(new float[] {1f}); fail(); } catch (IllegalArgumentException e) {}
+    try { sk.getQuantile(0.5); fail(); } catch (IllegalArgumentException e) {}
+    try { sk.getQuantiles(new double[] {0.5}); fail(); } catch (IllegalArgumentException e) {}
+    try { sk.getPMF(new float[] {1f}); fail(); } catch (IllegalArgumentException e) {}
+    try { sk.getCDF(new float[] {1f}); fail(); } catch (IllegalArgumentException e) {}
     assertTrue(BaseReqSketch.getRSE(50, 0.5, true, 0) > 0);
     assertTrue(sk.getRankUpperBound(0.5, 1) > 0);
   }
diff --git a/src/test/java/org/apache/datasketches/req/ReqSketchTest.java b/src/test/java/org/apache/datasketches/req/ReqSketchTest.java
index 64ba7db4..dda5f241 100644
--- a/src/test/java/org/apache/datasketches/req/ReqSketchTest.java
+++ b/src/test/java/org/apache/datasketches/req/ReqSketchTest.java
@@ -23,7 +23,6 @@ import static org.apache.datasketches.quantilescommon.QuantileSearchCriteria.EXC
 import static org.apache.datasketches.quantilescommon.QuantileSearchCriteria.INCLUSIVE;
 import static org.testng.Assert.assertEquals;
 import static org.testng.Assert.assertFalse;
-import static org.testng.Assert.assertTrue;
 import static org.testng.Assert.fail;
 
 import org.apache.datasketches.common.SketchesArgumentException;
@@ -37,7 +36,7 @@ import org.testng.annotations.Test;
 /**
  * @author Lee Rhodes
  */
-@SuppressWarnings({"unused","javadoc"})
+@SuppressWarnings("unused")
 public class ReqSketchTest {
   private static final String LS = System.getProperty("line.separator");
 
@@ -289,8 +288,14 @@ public class ReqSketchTest {
     final Memory mem = Memory.wrap(sk1Arr);
     final ReqSketch sk2 = ReqSketch.heapify(mem);
     assertEquals(sk2.getNumRetained(), sk1.getNumRetained());
-    assertEquals(sk2.getMinItem(), sk1.getMinItem());
-    assertEquals(sk2.getMaxItem(), sk1.getMaxItem());
+    assertEquals(sk1.isEmpty(), sk2.isEmpty());
+    if (sk2.isEmpty()) {
+      try { sk2.getMinItem(); fail(); } catch (IllegalArgumentException e) {}
+      try { sk2.getMaxItem(); fail(); } catch (IllegalArgumentException e) {}
+    } else {
+      assertEquals(sk2.getMinItem(), sk1.getMinItem());
+      assertEquals(sk2.getMaxItem(), sk1.getMaxItem());
+    }
     assertEquals(sk2.getN(), sk1.getN());
     assertEquals(sk2.getHighRankAccuracyMode(),sk1.getHighRankAccuracyMode());
     assertEquals(sk2.getK(), sk1.getK());


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datasketches.apache.org
For additional commands, e-mail: commits-help@datasketches.apache.org