code: DB db() {
      DB _db = this._db.get();
      if (_db == null) {
        throw new IllegalStateException("DB is closed.");
      }
      return _db;
    }
docs: Try to avoid use-after close since that has the tendency of crashing the JVM. This doesn't
  prevent methods that retrieved the instance from using it after close, but hopefully will
  catch most cases; otherwise, we'll need some kind of locking.