private boolean isValid(DomainFolder sessionFolder, String sessionName, DomainFile sourceFile,
			DomainFile destinationFile) {
		if (sessionFolder == null) {
			setStatusMessage("Choose a project folder to continue!");
			return false;
		}
		if (sourceFile == null) {
			setStatusMessage("Please choose a source program.");
			return false;
		}
		if (destinationFile == null) {
			setStatusMessage("Please choose a destination program.");
			return false;
		}
		if (sourceFile.equals(destinationFile)) {
			setStatusMessage("Source and destination files must be different.");
			return false;
		}
		if (StringUtils.isBlank(sessionName)) {
			setStatusMessage("Please enter a name for this session");
			return false;
		}
		try {
			tool.getProject().getProjectData().testValidName(sessionName, false);
		}
		catch (InvalidNameException e) {
			setStatusMessage("'" + sessionName + "' contains invalid characters");
			return false;
		}

		DomainFile file = sessionFolder.getFile(sessionName);
		if (file != null) {
			setStatusMessage(
				"'" + file.getPathname() + "' is the name of an existing project file");
			return false;
		}
		return true;
	}
Wizard step in the new version tracking session wizard for choosing which programs to 
track and naming the session.
Ghidra/Features/VersionTracking/src/main/java/ghidra/feature/vt/gui/wizard/session/SessionConfigurationStep.java