// Check the sample times
assertEquals(sampleWithSubResultsTime + sample1Time + sample2Time, totalTime);
// Check that calculator gets the correct statistics from the sample
Calculator calculator = new Calculator();
calculator.addSample(resWithSubResults);
assertEquals(600, calculator.getTotalBytes());
assertEquals(1, calculator.getCount());
assertEquals(1d / (totalTime / 1000d), calculator.getRate(),0.0001d); // Allow for some margin of error
// Check that the throughput uses the time elapsed for the sub results
assertFalse(1d / (sampleWithSubResultsTime / 1000d) <= calculator.getRate());
}