docs: @SuppressWarnings("unchecked")
      public void close() {
          synchronized (documentStores) {
              DocumentStore ds = documentStores.remove(location);
              if (ds != null) {
                  database.close();
                  ((QueryImpl)query).close();
              }
              else {
                  throw new IllegalStateException("DocumentStore "+location+" already closed");
              }
          }
          eventBus.post(new DocumentStoreClosed(databaseName));
      }