MetricRecorder implements Recorder<T> { @Override public T captureInterval() { return captureInterval(clock.nanoTime()); } MetricRecorder(T active, T inactive, FlipControl<T> flipControl, Clock clock); @Override T activeInterval(); @Override long activeIntervalStart(); @Override T captureInterval(); @Override T captureInterval(long nanotime); @Override T captureInterval(T newInterval); @Override synchronized T captureInterval(T newInterval, long nanoTime); long startRecord(); void endRecord(long permit);  }
@Test public void captureReturnsUsesCounterIfPassed() { LongAdderCounter<Unrejectable> newCounter = mock(LongAdderCounter.class); recorder.captureInterval(newCounter, 200L); verify(flipControl).flip(newCounter); }