code: private static void ifChanged(Deque<Double> stack) {
      double v2 = stack.removeFirst();
      double v1 = stack.removeFirst();
      double num = stack.removeFirst();
      stack.addFirst((Double.compare(v1, v2) == 0) ? 0.0 : num);
    }
docs: Helper to zero out a value if there is not a change. For a stack with {@code num v1 v2},
  if {@code v1 == v2}, then push 0.0 otherwise push {@code num}.
  
  For some values placed in JMX they are not regularly updated in all circumstances and
  reporting the same value for each polling iteration gives the false impression of activity
  when there is none. A common example is timers with the metrics library where the reservoir
  is not rescaled during a fetch.
  
  https://github.com/dropwizard/metrics/issues/1030
  
  This operator can be used in conjunction with the previous variables to zero out the
  misleading snapshots based on the count. For example:
  
  <pre>
  {50thPercentile},{Count},{previous:Count},:if-changed
  </pre>