docs: @Override
      public void close() {
          if (!closed.getAndSet(true)) {
              if (classpathOrder != null) {
                  classpathOrder.clear();
                  classpathOrder = null;
              }
              if (allWhitelistedResourcesCached != null) {
                  for (final Resource classpathResource : allWhitelistedResourcesCached) {
                      classpathResource.close();
                  }
                  allWhitelistedResourcesCached.clear();
                  allWhitelistedResourcesCached = null;
              }
              if (pathToWhitelistedResourcesCached != null) {
                  pathToWhitelistedResourcesCached.clear();
                  pathToWhitelistedResourcesCached = null;
              }
              classGraphClassLoader = null;
              if (classNameToClassInfo != null) {
                  classNameToClassInfo.clear();
                  classNameToClassInfo = null;
              }
              if (packageNameToPackageInfo != null) {
                  packageNameToPackageInfo.clear();
                  packageNameToPackageInfo = null;
              }
              if (moduleNameToModuleInfo != null) {
                  moduleNameToModuleInfo.clear();
                  moduleNameToModuleInfo = null;
              }
              if (fileToLastModified != null) {
                  fileToLastModified.clear();
                  fileToLastModified = null;
              }
              // nestedJarHandler should be closed last, since it needs to have all MappedByteBuffer refs
              // dropped before it tries to delete any temporary files that were written to disk
              if (nestedJarHandler != null) {
                  nestedJarHandler.close(topLevelLog);
                  nestedJarHandler = null;
              }
              classGraphClassLoader = null;
              classLoaderOrderRespectingParentDelegation = null;
              // Remove WeakReference to this ScanResult, so shutdown hook does not try to close this
              nonClosedWeakReferences.remove(weakReference);
              // Flush log on exit, in case additional log entries were generated after scan() completed
              if (topLevelLog != null) {
                  topLevelLog.flush();
              }
          }
      }