code: public void destroy() {
          try {
              if (indexReader != null) {
                  indexReader.close();
              }
              
              writer.close();
              indexTracker.save();
          } catch (IOException e) {
              throw MiscUtil.toUnchecked(e);
          }
      }
docs: Release/update resources upon destruction.