### Question:
TokenOperationsStore { public long getOperationsCumulativeCount(TokenType type, CTSOperation operation) { if (!tokenOperations.containsKey(type)) { return 0L; } return tokenOperations.get(type).getCount(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 shouldGetOperationsCumulativeCountForSpecificTokenType() { TokenType tokenType = TokenType.OAUTH; CTSOperation operation = CTSOperation.CREATE; OperationStore typeOperationStore = mock(OperationStore.class); tokenOperations.put(TokenType.OAUTH, typeOperationStore); given(typeOperationStore.getCount(operation)).willReturn(1L); long result = tokenOperationsStore.getOperationsCumulativeCount(tokenType, operation); assertEquals(result, 1L); }
@Test public void getOperationsCumulativeCountForSpecificTokenTypeShouldReturnZeroIfTokenTypeNotSet() { TokenType tokenType = TokenType.OAUTH; CTSOperation operation = CTSOperation.CREATE; long result = tokenOperationsStore.getOperationsCumulativeCount(tokenType, operation); assertEquals(result, 0L); }
@Test public void shouldGetOperationsCumulativeCount() { CTSOperation operation = CTSOperation.CREATE; given(operationStore.getCount(operation)).willReturn(1L); long result = tokenOperationsStore.getOperationsCumulativeCount(operation); assertEquals(result, 1L); }