HystrixRollingNumber { public long getRollingSum(HystrixRollingNumberEvent type) { Bucket lastBucket = getCurrentBucket(); if (lastBucket == null) return 0; long sum = 0; for (Bucket b : buckets) { sum += b.getAdder(type).sum(); } return sum; } @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 testEmptySum() { MockedTime time = new MockedTime(); HystrixRollingNumberEvent type = HystrixRollingNumberEvent.COLLAPSED; HystrixRollingNumber counter = new HystrixRollingNumber(time, 200, 10); assertEquals(0, counter.getRollingSum(type)); }