@Override
		protected Comparator<ExternalNamesRow> createSortComparator(int columnIndex) {
			if (columnIndex == PATH_COL) {
				// force the path column to have a secondary compare using the name column
				// to ensure a 'stable' sort.  Without this during analysis
				// the constant updates cause the table to sort randomly when
				// there are lots of empty path values. 
				Comparator<ExternalNamesRow> c1 =
					(r1, r2) -> Objects.requireNonNullElse(r1.getPath(), "")
							.compareTo(Objects.requireNonNullElse(r2.getPath(), ""));
				return c1.thenComparing((r1, r2) -> r1.getName().compareTo(r2.getName()));
			}
			return super.createSortComparator(columnIndex);
		}
ComponentProvider that displays a table of External Programs.
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/references/ExternalReferencesProvider.java