### Question:
SpywarePluginLayer implements Closeable { @Override public void close() { try { activeThreads.joinAll(); } catch (InterruptedException e) { } } SpywarePluginLayer(ActiveThreadSet activeThreads, EventReceiver receiver, SnapshotTaker taker,
            DocumentChangeHandler documentHandler); void takeSnapshot(SnapshotInfo info); void documentChange(DocumentInfo info); @Override void close();  }### Answer:
@Test public void closeCallsJoinAllForActiveThreads() throws InterruptedException { spl.close(); verify(activeThreads, times(1)).joinAll(); }
@Test public void closeGracefullyHandlesException() throws InterruptedException { doThrow(new InterruptedException()).when(activeThreads).joinAll(); spl.close(); }