private Window findNextValidWindow(Window[] windows, int currentIndex) {
		int candidateIndex = nextIndex(windows, currentIndex);
		while (candidateIndex != currentIndex) {
			if (isValid(windows[candidateIndex])) {
				return windows[candidateIndex];
			}
			candidateIndex = nextIndex(windows, candidateIndex);
		}
		return null;
	}
Action for transferring focus to the next or previous visible window in the application.
Ghidra/Framework/Docking/src/main/java/docking/action/NextPreviousWindowAction.java