### Question:
ResourceModelStatistics { double getTotalMappingDuration() { double totalDuration = 0L; double leftBoundary = 0; for (int i = 0; i < this.mappingDurationFrequencies.length; ++i) { double rightBoundary = this.indexBoundaries[i]; double intervalMean = (leftBoundary + rightBoundary) / 2; totalDuration += intervalMean * this.mappingDurationFrequencies[i]; leftBoundary = this.indexBoundaries[i]; } return totalDuration; } ResourceModelStatistics(); ResourceModelStatistics countInstantiation(); ResourceModelStatistics countSubsequentMapping(); ResourceModelStatistics countCacheHit(); ResourceModelStatistics countMappingDuration(int durationInMs);  }### Answer:
@Test public void testTotalMappingTimeCalculation() { int[] durations = {290, 180, 290, 300, 300, 310, 330, 270, 270, 180, 330}; withDurations(durations); assertThat(this.testee.getTotalMappingDuration()).isEqualTo(3840); }