### Question:
TokenOperationsStore { public double getAverageOperationFailuresPerPeriod(CTSOperation operation) { return operationFailureStore.getAverageRate(operation); } TokenOperationsStore();   TokenOperationsStore(final OperationStoreFactory operationStoreFactory,
            final Map<TokenType, OperationStore> tokenOperations,
            final OperationStore operationStore,
            final OperationStore operationFailureStore); void addTokenOperation(TokenType type, CTSOperation operation, boolean success); void addTokenOperation(CTSOperation operation, boolean success); double getAverageOperationsPerPeriod(TokenType type, CTSOperation operation); long getMinimumOperationsPerPeriod(TokenType type, CTSOperation operation); long getMaximumOperationsPerPeriod(TokenType type, CTSOperation operation); double getAverageOperationsPerPeriod(CTSOperation operation); double getAverageOperationFailuresPerPeriod(CTSOperation operation); long getMinimumOperationsPerPeriod(CTSOperation operation); long getMinimumOperationFailuresPerPeriod(CTSOperation operation); long getMaximumOperationsPerPeriod(CTSOperation operation); long getMaximumOperationFailuresPerPeriod(CTSOperation operation); long getOperationsCumulativeCount(TokenType type, CTSOperation operation); long getOperationsCumulativeCount(CTSOperation operation); long getOperationFailuresCumulativeCount(CTSOperation operation);  }### Answer:
@Test public void shouldGetAverageFailureRateForOperation() { operationFailureStore = mock(OperationStore.class); tokenOperationsStore = new TokenOperationsStore(operationStoreFactory, tokenOperations, operationStore, operationFailureStore); CTSOperation operation = CTSOperation.READ; double failureRate = 3.14159; given(operationFailureStore.getAverageRate(operation)).willReturn(failureRate); double result = tokenOperationsStore.getAverageOperationFailuresPerPeriod(operation); assertEquals(result, failureRate); }