docs: public ScanResult scan(final ExecutorService executorService, final int numParallelTasks) {
          try {
              // Start the scan and wait for completion
  
              // Return the scanResult, then block waiting for the result
              final ScanResult scanResult = scanAsync(executorService, numParallelTasks).get();
  
              //    // Test serialization/deserialization by serializing and then deserializing the ScanResult 
              //    if (scanSpec.enableClassInfo && scanSpec.performScan) {
              //        final String scanResultJson = scanResult.toJSON(2);
              //        final ScanResult scanResultFromJson = ScanResult.fromJSON(scanResultJson);
              //        final String scanResultJson2 = scanResult.toJSON(2);
              //        if (!scanResultJson2.equals(scanResultJson)) {
              //            throw new RuntimeException("Serialization mismatch");
              //        }
              //        scanResult = scanResultFromJson;
              //    }
  
              // The resulting scanResult cannot be null, but check for null to keep SpotBugs happy
              if (scanResult == null) {
                  throw new NullPointerException();
              }
              return scanResult;
  
          } catch (final InterruptedException | CancellationException e) {
              throw ClassGraphException.newClassGraphException("Scan interrupted", e);
          } catch (final ExecutionException e) {
              throw ClassGraphException.newClassGraphException("Uncaught exception during scan",
                      InterruptionChecker.getCause(e));
          }
      }