code: private static <E> void validateCounter(Counter<E> counts) {
      for (Map.Entry<E, Double> entry : counts.entrySet()) {
        E item = entry.getKey();
        Double dblCount = entry.getValue();
        if (dblCount == null) {
          throw new IllegalArgumentException("ERROR: null count for item " + item + "!");
        }
        if (dblCount < 0) {
          throw new IllegalArgumentException("ERROR: negative count " + dblCount + " for item " + item + "!");
        }
      }
    }
docs: /* Helper to simpleGoodTuringSmoothedCounter()