@Override
    public void suspendAll(HostName parentHostname, List<HostName> hostNames)
            throws BatchHostStateChangeDeniedException, BatchHostNameNotFoundException, BatchInternalErrorException {
        try (OrchestratorContext context = OrchestratorContext.createContextForMultiAppOp(clock)) {
            List<NodeGroup> nodeGroupsOrderedByApplication;
            try {
                nodeGroupsOrderedByApplication = nodeGroupsOrderedForSuspend(hostNames);
            } catch (HostNameNotFoundException e) {
                throw new BatchHostNameNotFoundException(parentHostname, hostNames, e);
            }

            suspendAllNodeGroups(context, parentHostname, nodeGroupsOrderedByApplication, true);
            suspendAllNodeGroups(context, parentHostname, nodeGroupsOrderedByApplication, false);
        }
    }
@Test
    public void suspendAllWorks() {
        // A spy is preferential because suspendAll() relies on delegating the hard work to suspend() and resume().
        OrchestratorImpl orchestrator = spy(this.orchestrator);

        orchestrator.suspendAll(
                new HostName("parentHostname"),
                List.of(
                        DummyServiceMonitor.TEST1_HOST_NAME,
                        DummyServiceMonitor.TEST3_HOST_NAME,
                        DummyServiceMonitor.TEST6_HOST_NAME));

        // As of 2016-06-07 the order of the node groups are as follows:
        //   TEST3: mediasearch:imagesearch:default
        //   TEST6: tenant-id-3:application-instance-3:default
        //   TEST1: test-tenant-id:application:instance
        InOrder order = inOrder(orchestrator);
        verifySuspendGroup(order, orchestrator, DummyServiceMonitor.TEST3_NODE_GROUP, true);
        verifySuspendGroup(order, orchestrator, DummyServiceMonitor.TEST6_NODE_GROUP, true);
        verifySuspendGroup(order, orchestrator, DummyServiceMonitor.TEST1_NODE_GROUP, true);
        verifySuspendGroup(order, orchestrator, DummyServiceMonitor.TEST3_NODE_GROUP, false);
        verifySuspendGroup(order, orchestrator, DummyServiceMonitor.TEST6_NODE_GROUP, false);
        verifySuspendGroup(order, orchestrator, DummyServiceMonitor.TEST1_NODE_GROUP, false);
        order.verifyNoMoreInteractions();
    }