GroupingManager { public void addNewContainerToGroupingRequest(String groupLeaderContainerId, String affectedContainerId) { if (groupLeaderContainerId != null && affectedContainerId != null) { GroupingRequest request = getGroupingRequest(groupLeaderContainerId); if (request != null) { request.addAffectedContainer(affectedContainerId); } } }  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 testAddNewContainerToGroupingRequest() { String groupLeaderContainerId = "container_1"; String newAffectedContainerId = "container_11"; underTest.addOrModifyGroupingRequest(groupLeaderContainerId, ImmutableSet.of(oper1)); underTest.addNewContainerToGroupingRequest(groupLeaderContainerId, newAffectedContainerId); GroupingRequest request = underTest.getGroupingRequest(groupLeaderContainerId); Assert.assertTrue(request.getAffectedContainers().contains(newAffectedContainerId)); }