HystrixRollingNumber { public long getRollingMaxValue(HystrixRollingNumberEvent type) { long values[] = getValues(type); if (values.length == 0) { return 0; } else { Arrays.sort(values); return values[values.length - 1]; } } @Deprecated  HystrixRollingNumber(HystrixProperty<Integer> timeInMilliseconds, HystrixProperty<Integer> numberOfBuckets);  HystrixRollingNumber(int timeInMilliseconds, int numberOfBuckets);   HystrixRollingNumber(Time time, int timeInMilliseconds, int numberOfBuckets); void increment(HystrixRollingNumberEvent type); void add(HystrixRollingNumberEvent type, long value); void updateRollingMax(HystrixRollingNumberEvent type, long value); void reset(); long getCumulativeSum(HystrixRollingNumberEvent type); long getRollingSum(HystrixRollingNumberEvent type); long getValueOfLatestBucket(HystrixRollingNumberEvent type); long[] getValues(HystrixRollingNumberEvent type); long getRollingMaxValue(HystrixRollingNumberEvent type);  }
@Test public void testEmptyMax() { MockedTime time = new MockedTime(); HystrixRollingNumberEvent type = HystrixRollingNumberEvent.THREAD_MAX_ACTIVE; HystrixRollingNumber counter = new HystrixRollingNumber(time, 200, 10); assertEquals(0, counter.getRollingMaxValue(type)); }