### Question:
QuiescingStreamManager extends StreamManager { public boolean setQuiescent(boolean quiescent) throws IOException { try { stateLock.lockInterruptibly(); if (quiescent && !this.quiescent) { synchronized (openOutputStreams) { while (!openOutputStreams.isEmpty()) { log.info("setQuiescent: Waiting for " + openOutputStreams.size() + " output streams to close..."); openOutputStreams.wait(); } } synchronized (txnCons) { int cnt; while ((cnt = countWriteTransactions()) > 0) { log.info("setQuiescent: Waiting for " + cnt + " write transactions to close..."); txnCons.wait(); } } synchronized (rawCons) { for (QuiescingBlobStoreConnection con : rawCons) { if (con.hasModifications()) con.sync(); } } log.info("setQuiescent: No open output streams or active write transactions. " + "Entering quiescent state."); } if (!quiescent && this.quiescent) { log.info("setQuiescent: Exiting quiescent state."); becameUnquiescent.signalAll(); } this.quiescent = quiescent; return true; } catch (InterruptedException ie) { if (quiescent) log.warn("Interrupted while waiting to enter quiescent state", ie); else log.warn("Interrupted while waiting to exit quiescent state", ie); return false; } finally { if (stateLock.isHeldByCurrentThread()) stateLock.unlock(); } }  void lockUnquiesced(); void unlockState(); boolean setQuiescent(boolean quiescent); @Override OutputStream manageOutputStream(BlobStoreConnection con, OutputStream stream);  }### Answer:
@Test(dependsOnGroups = { "init" }) public void testGoUnquiescentBlocking() throws Exception { assertTrue(manager.setQuiescent(true)); LockUnquiescedThread thread = new LockUnquiescedThread(manager); thread.start(); Thread.sleep(100); assertTrue(thread.isAlive()); assertTrue(manager.setQuiescent(false)); thread.join(); assertNull(thread.getException()); }
@Test(dependsOnGroups = { "init" }) public void testGoUnquiescentInterrupted() throws Exception { assertTrue(manager.setQuiescent(true)); LockUnquiescedThread thread = new LockUnquiescedThread(manager); thread.start(); Thread.sleep(100); assertTrue(thread.isAlive()); thread.interrupt(); thread.join(); assertNotNull(thread.getException()); assertTrue(manager.setQuiescent(false)); }