@Test public void testNoops() { SampledCounterConfig configSec = new SampledCounterConfig(1, 10, true, 0); SampledCounterImpl counter1 = new SampledCounterImpl(configSec); SampledCounterImpl counter2 = new SampledCounterImpl(configSec); SampledCounterImpl counter3 = new SampledCounterImpl(configSec); SummedSampledCounter summedCounter = new SummedSampledCounter(configSec, counter1, counter2, counter3); counter1.setValue(10); counter2.setValue(10); counter3.setValue(10); summedCounter.decrement(); summedCounter.decrement(10); summedCounter.increment(); summedCounter.increment(10); summedCounter.setValue(100); summedCounter.getAndReset(); Assert.assertEquals(30, summedCounter.getValue()); }
@Override public long getValue() { long l = 0; for (SampledCounter sc : delegates) { l = l + sc.getValue(); } return l; }
SummedSampledCounter extends DerivedSampledCounterImpl { @Override public long getValue() { long l = 0; for (SampledCounter sc : delegates) { l = l + sc.getValue(); } return l; } }
SummedSampledCounter extends DerivedSampledCounterImpl { @Override public long getValue() { long l = 0; for (SampledCounter sc : delegates) { l = l + sc.getValue(); } return l; } SummedSampledCounter(SampledCounterConfig config, SampledCounter... delegates); }
SummedSampledCounter extends DerivedSampledCounterImpl { @Override public long getValue() { long l = 0; for (SampledCounter sc : delegates) { l = l + sc.getValue(); } return l; } SummedSampledCounter(SampledCounterConfig config, SampledCounter... delegates); @Override long getValue(); }
SummedSampledCounter extends DerivedSampledCounterImpl { @Override public long getValue() { long l = 0; for (SampledCounter sc : delegates) { l = l + sc.getValue(); } return l; } SummedSampledCounter(SampledCounterConfig config, SampledCounter... delegates); @Override long getValue();  }