private Component getPrevious(Component aComponent, List<Component> list) {
			int currentIndex = list.indexOf(aComponent);
			if (currentIndex < 0) {
				// The given component is not in the list of traversal components.  This can happen
				// when some widget in the panel has focus but is not part of the focus traversal.
				// Assume the component is part of a group of components that can be traversed.  Get
				// the previous component before this group.
				return getPreviousGroupComponent(aComponent, list);
			}

			int previousIndex = currentIndex - 1;
			if (previousIndex == -1) {
				previousIndex = list.size() - 1; // wrap
			}

			Component previous = list.get(previousIndex);
			if (!previous.isFocusable() || !previous.isEnabled()) {
				return getPrevious(previous, list);
			}
			return previous;
		}
Finds the first sibling of the given component in the given list.  

@param component the component that is not in the list, but has a sibling in the list
@param list the list of focus traversal components
@return the sibling or null
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/compositeeditor/CompositeEditorPanel.java