### Question:
OperationsHelper { public List<Operation> findOperations(List<Operation> operations, List<Operation.State> statusList) { operations = addState(operations); return filterBasedOnStates(operations, statusList); } @Inject  OperationsHelper(OperationService operationService, ProcessTypeToOperationMetadataMapper metadataMapper,
                            ProcessHelper processHelper); String getProcessDefinitionKey(Operation operation); Operation addErrorType(Operation operation); Operation addState(Operation operation); Operation.State computeState(Operation operation); Operation.State computeProcessState(String processId); List<Operation> findOperations(List<Operation> operations, List<Operation.State> statusList);  }### Answer:
@Test void testFindOperationsWithStatusRunning() { List<Operation> operations = List.of(createMockedOperation("12af8e1e-4d96-11ea-b77f-2e728ce88178", ProcessType.DEPLOY, Operation.State.RUNNING), createMockedOperation("13af8e1e-4d96-11ea-b77f-2e728ce88178", ProcessType.DEPLOY, Operation.State.ABORTED)); List<Operation.State> statusList = List.of(Operation.State.RUNNING); List<Operation> foundOperations = operationsHelper.findOperations(operations, statusList); Assertions.assertEquals(1, foundOperations.size()); Assertions.assertEquals("12af8e1e-4d96-11ea-b77f-2e728ce88178", operations.get(0) .getProcessId()); }
@Test void testFundOperationsWithoutStatus() { List<Operation> operations = List.of(createMockedOperation("12af8e1e-4d96-11ea-b77f-2e728ce88178", ProcessType.DEPLOY, Operation.State.RUNNING), createMockedOperation("13af8e1e-4d96-11ea-b77f-2e728ce88178", ProcessType.DEPLOY, Operation.State.ABORTED)); List<Operation> foundOperations = operationsHelper.findOperations(operations, Collections.emptyList()); Assertions.assertEquals(2, foundOperations.size()); }