private Set<File> findCacheDirs(String appName, ApplicationLayout layout) {
		Set<File> discoveredDirs = new LinkedHashSet<>();

		// Legacy cache directories
		if (OperatingSystem.CURRENT_OPERATING_SYSTEM.equals(OperatingSystem.WINDOWS)) {
			getDirFromEnv("LOCALAPPDATA", appName).ifPresent(discoveredDirs::add);
		}
		else {
			String legacyName = SystemUtilities.getUserName() + "-" + appName;
			getDirFromProperty("java.io.tmpdir", legacyName).ifPresent(discoveredDirs::add);
		}

		// Newer cache directories always use a lowercase application name
		appName = ApplicationUtilities.normalizeApplicationName(appName);
		String userNameAndAppName = SystemUtilities.getUserName() + "-" + appName;

		// Current cache directories
		File cacheDir = layout.getUserCacheDir();
		if (cacheDir != null && cacheDir.isDirectory()) {
			discoveredDirs.add(cacheDir);
		}

		// Application system property override (likely not set for AppCleaner)
		getDirFromProperty(PROPERTY_CACHE_DIR, appName).ifPresent(discoveredDirs::add);
		getDirFromProperty(PROPERTY_CACHE_DIR, userNameAndAppName).ifPresent(discoveredDirs::add);

		// XDG environment variable override
		getDirFromEnv(XDG_CACHE_HOME, appName).ifPresent(discoveredDirs::add);
		getDirFromEnv(XDG_CACHE_HOME, userNameAndAppName).ifPresent(discoveredDirs::add);

		return discoveredDirs;
	}
Finds user cache directories

@param appName The name of the application
@param layout The layout
@return A {@link Set} of discovered user cache directories, ordered such that
  parent directories are directly followed by their subdirectories, if applicable
@see ApplicationUtilities#getDefaultUserCacheDir(ApplicationProperties)
Ghidra/Framework/Utility/src/main/java/utility/application/AppCleaner.java