@Override
    public void close() throws IOException
    {
        if ( state.compareAndSet(State.STARTED, State.CLOSED) )
        {
            client.getConnectionStateListenable().removeListener(connectionStateListener);
            listeners.clear();
            executorService.close();
            client.clearWatcherReferences(childrenWatcher);
            client.clearWatcherReferences(dataWatcher);

            // TODO
            // This seems to enable even more GC - I'm not sure why yet - it
            // has something to do with Guava's cache and circular references
            connectionStateListener = null;
            childrenWatcher = null;
            dataWatcher = null;
        }
    }
@ Override public void close ( ) throws IOException { if ( state . compareAndSet ( State . STARTED , State . CLOSED ) ) { client . getConnectionStateListenable ( ) . removeListener ( connectionStateListener ) ; listeners . clear ( ) ; executorService . close ( ) ; client . clearWatcherReferences ( childrenWatcher ) ; client . clearWatcherReferences ( dataWatcher ) ; connectionStateListener = null ; childrenWatcher = null ; dataWatcher = null ; } }
Close/end the cache

@throws IOException errors