GroupingManager { public EventGroupId moveOperatorFromUndeployListToDeployList(PTOperator oper) { EventGroupId groupId = null; for (GroupingRequest request : groupingRequests.values()) { if (request.getOperatorsToUndeploy().contains(oper.getId())) { groupId = request.getEventGroupId(); request.removeOperatorToUndeploy(oper.getId()); request.addOperatorToDeploy(oper.getId()); } } return groupId; }  static GroupingManager getGroupingManagerInstance(); Map<String, GroupingRequest> getGroupingRequests(); GroupingRequest getGroupingRequest(String containerId); EventGroupId getEventGroupIdForContainer(String containerId); EventGroupId getEventGroupIdForAffectedContainer(String containerId); EventGroupId getEventGroupIdForOperatorToDeploy(int operatorId); void addOperatorToDeploy(String containerId, PTOperator oper); boolean removeOperatorFromGroupingRequest(int operatorId); void removeProcessedGroupingRequests(); GroupingRequest addOrModifyGroupingRequest(String containerId, Set<PTOperator> affectedOperators); void addNewContainerToGroupingRequest(String groupLeaderContainerId, String affectedContainerId); EventGroupId moveOperatorFromUndeployListToDeployList(PTOperator oper); void clearAllGroupingRequests();  }
@Test public void testMoveOperatorFromUndeployListToDeployList() { String failedContainerId = "container_1"; underTest.addOrModifyGroupingRequest(failedContainerId, ImmutableSet.of(oper1)); underTest.moveOperatorFromUndeployListToDeployList(oper1); GroupingRequest request = underTest.getGroupingRequest(failedContainerId); Assert.assertFalse(request.getOperatorsToUndeploy().contains(oper1.getId())); Assert.assertTrue(request.getOperatorsToDeploy().contains(oper1.getId())); }