code: public void waitBackgroundTaskFinished() throws Exception {
          boolean upToDate;
          synchronized (currentIndexes) {
              upToDate = classpathVersion == indexVersion;
          }
          while (!upToDate) {
              INDEXER.submit(() -> {}).get();
              synchronized (currentIndexes) {
                  upToDate = classpathVersion == indexVersion;
              }
          }
      }
docs: for tests, to be able to wait until the indexing finishes: