### Question:
OrbTrackerMemberDataServiceImpl extends RemoteServiceServlet implements
    OrbTrackerMemberDataService, Watcher { @Override public String[] getJobsInProgress() throws NodeDoesNotExistException, ZooKeeperConnectionException, WatcherException { if (zk == null) { try { initializeZooKeeper(); } catch (Exception e) { throw new ZooKeeperConnectionException(e); } } if (jobsInProgressWatcher == null) { try { initializeJobMonitor("JobsInProgress"); } catch (OrbZKFailure e) { throw new WatcherException(e); } } return jobsInProgress; }  @Override OrbTrackerMemberData[] getOrbTrackerMemberData(); synchronized void updateNodeData(OrbTrackerMemberData updatedNode); synchronized void removeNodeData(String nodeName); @Override void process(WatchedEvent event); @Override String[] getJobsInQueue(); @Override String[] getJobsInProgress(); void updateJobs(String[] jobs, String nodeName); void enterTestingMode(CountDownLatch jobsLatch,
                               CountDownLatch removeLatch,
                               CountDownLatch updateLatch); void exitTestingMode(); void setUpdateLatch(CountDownLatch updateLatch); void setRemoveLatch(CountDownLatch removeLatch); void setJobsLatch(CountDownLatch jobsLatch); void setLatches(CountDownLatch jobsLatch, CountDownLatch removeLatch, CountDownLatch updateLatch); void watcherNodeDeleted(String node);  }### Answer:
@Test public void testGetJobsInProgress() throws OrbZKFailure, NodeDoesNotExistException, ZooKeeperConnectionException, WatcherException, InterruptedException, KeeperException { OrbTrackerMemberDataServiceImpl server = new OrbTrackerMemberDataServiceImpl(); int num_jobs = 10; CountDownLatch jobsLatch = new CountDownLatch(1); CountDownLatch updateLatch = new CountDownLatch(1); CountDownLatch removeLatch = new CountDownLatch(1); server.enterTestingMode(jobsLatch, removeLatch, updateLatch); for (int i = 0; i < num_jobs; i++) { ZookeeperUtils.tryToCreateNode(zk, jobsInProgressPath + "/job", CreateMode.EPHEMERAL_SEQUENTIAL); } String[] job = server.getJobsInProgress(); jobsLatch.await(); List<String> nodes = zk.getChildren(jobsInProgressPath, false); job = server.getJobsInProgress(); assertEquals(nodes.size(), job.length); jobsLatch = new CountDownLatch(3); server.setJobsLatch(jobsLatch); for (int i = 0; i < 3; i++) { ZookeeperUtils.tryToCreateNode(zk, jobsInProgressPath + "/job", CreateMode.EPHEMERAL_SEQUENTIAL); Thread.sleep(5); } jobsLatch.await(); nodes = zk.getChildren(jobsInProgressPath, false); job = server.getJobsInProgress(); assertEquals(nodes.size(), job.length); jobsLatch = new CountDownLatch(5); server.setJobsLatch(jobsLatch); for (int i = 0; i < 5; i++) { ZookeeperUtils.deleteNodeIfEmpty(zk, jobsInProgressPath + "/" + nodes.get(i)); Thread.sleep(5); } jobsLatch.await(); nodes = zk.getChildren(jobsInProgressPath, false); job = server.getJobsInProgress(); assertEquals(nodes.size(), job.length); }