### Question:
AssignmentManager extends ZooKeeperListener { public void shutdown() { synchronized (zkEventWorkerWaitingList){ zkEventWorkerWaitingList.clear(); } threadPoolExecutorService.shutdownNow(); zkEventWorkers.shutdownNow(); } AssignmentManager(Server server, ServerManager serverManager,
      CatalogTracker catalogTracker, final LoadBalancer balancer,
      final ExecutorService service, MetricsMaster metricsMaster,
      final TableLockManager tableLockManager); ZKTable getZKTable(); RegionStates getRegionStates(); RegionPlan getRegionReopenPlan(HRegionInfo hri); void addPlan(String encodedName, RegionPlan plan); void addPlans(Map<String, RegionPlan> plans); void setRegionsToReopen(List <HRegionInfo> regions); Pair<Integer, Integer> getReopenStatus(TableName tableName); boolean isFailoverCleanupDone(); Lock acquireRegionLock(final String encodedName); void removeClosedRegion(HRegionInfo hri); @Override void nodeCreated(String path); @Override void nodeDataChanged(String path); @Override void nodeDeleted(final String path); @Override void nodeChildrenChanged(String path); void regionOffline(final HRegionInfo regionInfo); void offlineDisabledRegion(HRegionInfo regionInfo); void assign(HRegionInfo region, boolean setOfflineInZK); void assign(HRegionInfo region,
      boolean setOfflineInZK, boolean forceNewPlan); void unassign(HRegionInfo region); void unassign(HRegionInfo region, boolean force, ServerName dest); void unassign(HRegionInfo region, boolean force); void deleteClosingOrClosedNode(HRegionInfo region, ServerName sn); int getNumRegionsOpened(); boolean waitForAssignment(HRegionInfo regionInfo); void assignMeta(); void assign(Map<HRegionInfo, ServerName> regions); void assign(List<HRegionInfo> regions); void updateRegionsInTransitionMetrics(); void waitOnRegionToClearRegionsInTransition(final HRegionInfo hri); boolean waitOnRegionToClearRegionsInTransition(final HRegionInfo hri, long timeOut); boolean isCarryingMeta(ServerName serverName); List<HRegionInfo> processServerShutdown(final ServerName sn); void balance(final RegionPlan plan); void stop(); void shutdown(); static final ServerName HBCK_CODE_SERVERNAME; static final String ASSIGNMENT_TIMEOUT; static final int DEFAULT_ASSIGNMENT_TIMEOUT_DEFAULT; static final String ASSIGNMENT_TIMEOUT_MANAGEMENT; static final boolean DEFAULT_ASSIGNMENT_TIMEOUT_MANAGEMENT; static final String ALREADY_IN_TRANSITION_WAITTIME; static final int DEFAULT_ALREADY_IN_TRANSITION_WAITTIME; @edu.umd.cs.findbugs.annotations.SuppressWarnings(value="MS_SHOULD_BE_FINAL")
  static boolean TEST_SKIP_SPLIT_HANDLING; }### Answer:
@Test public void testShutdownHandler() throws KeeperException, IOException, ServiceException { ExecutorService executor = startupMasterExecutor("testShutdownHandler"); CatalogTracker ct = Mockito.mock(CatalogTracker.class); AssignmentManagerWithExtrasForTesting am = setUpMockedAssignmentManager( this.server, this.serverManager); try { processServerShutdownHandler(ct, am, false); } finally { executor.shutdown(); am.shutdown(); ZKAssign.deleteAllNodes(this.watcher); } }