private void reset() throws IOException {
    // Create a non-throttling quota for the second call, since throttling
    // should only happen on the first call
    OperationQuota nonThrottlingQuota = mock(OperationQuota.class);
    when(env.checkScanQuota(any(), anyLong(), anyLong())).thenReturn(nonThrottlingQuota);
  }
Test AggregateImplementation with throttling and partial results
hbase-endpoint/src/test/java/org/apache/hadoop/hbase/coprocessor/TestAggregateImplementation.java