code: public final void end() {
      final Thread thread = threadRef;
      if (thread != null) {
        thread.interrupt();
        try {
          thread.join();
        } catch (InterruptedException e) {
          Thread.currentThread().interrupt();
        }
      }
      this.threadRef = null;
    }
docs: Stops the scavenger.