@Override
 public String toString() {
   return "Discretizer(Trigger: "
       + triggerPolicy.toString()
       + ", Eviction: "
       + evictionPolicy.toString()
       + ")";
 }
  private void evict(IN input, boolean isTriggered) {
    int numToEvict = evictionPolicy.notifyEviction(input, isTriggered, bufferSize);

    if (numToEvict > 0) {
      output.collect(windowEvent.setEviction(numToEvict));
      bufferSize -= numToEvict;
      bufferSize = bufferSize >= 0 ? bufferSize : 0;
    }
  }
  @Override
  public boolean equals(Object other) {
    if (other == null
        || !(other instanceof StreamDiscretizer)
        || (other instanceof GroupedStreamDiscretizer)) {
      return false;
    } else {
      try {
        @SuppressWarnings("unchecked")
        StreamDiscretizer<IN> otherDiscretizer = (StreamDiscretizer<IN>) other;

        return triggerPolicy.equals(otherDiscretizer.triggerPolicy)
            && evictionPolicy.equals(otherDiscretizer.evictionPolicy);

      } catch (ClassCastException e) {
        return false;
      }
    }
  }