Fixed ServiceCache.close() to interrupt the cache's worker thread and shut down its ExecutorService. Note that the worker thread is interrupted *after* all the listeners are removed. So if the ZK watch triggers and the worker thread wakes up while the cache is being closed, it may send a cacheChanged() event to only some of the listeners. Because of this, it may be better to interrupt the worker thread (and make sure it's dead) *before* removing the listeners.
This ensures that unit tests will work and that packages that pull in curator-test will not pull in TestNG as a dependency.
…d factory if present
…rote it and hopefully have done a better job.
…ses is freaking hard.