public static TOperationState toTOperationState(OperationStatus operationStatus) {
        switch (operationStatus) {
            case INITIALIZED:
                return TOperationState.INITIALIZED_STATE;
            case PENDING:
                return TOperationState.PENDING_STATE;
            case RUNNING:
                return TOperationState.RUNNING_STATE;
            case FINISHED:
                return TOperationState.FINISHED_STATE;
            case ERROR:
                return TOperationState.ERROR_STATE;
            case TIMEOUT:
                return TOperationState.TIMEDOUT_STATE;
            case CANCELED:
                return TOperationState.CANCELED_STATE;
            case CLOSED:
                return TOperationState.CLOSED_STATE;
            default:
                throw new IllegalArgumentException(
                        String.format("Unknown operation status: %s.", operationStatus));
        }
    }
@Test
    public void testConvertOperationStatus() {
        Map<OperationStatus, TOperationState> expectedMappings = new HashMap<>();
        expectedMappings.put(INITIALIZED, TOperationState.INITIALIZED_STATE);
        expectedMappings.put(PENDING, TOperationState.PENDING_STATE);
        expectedMappings.put(RUNNING, TOperationState.RUNNING_STATE);
        expectedMappings.put(FINISHED, TOperationState.FINISHED_STATE);
        expectedMappings.put(CANCELED, TOperationState.CANCELED_STATE);
        expectedMappings.put(CLOSED, TOperationState.CLOSED_STATE);
        expectedMappings.put(ERROR, TOperationState.ERROR_STATE);
        expectedMappings.put(TIMEOUT, TOperationState.TIMEDOUT_STATE);

        for (OperationStatus status : expectedMappings.keySet()) {
            assertThat(expectedMappings.get(status)).isEqualTo(toTOperationState(status));
        }
    }