@Override
			public int compare(String o1, String o2) {
				boolean ii1 = o1.startsWith("[") && o1.endsWith("]");
				boolean ii2 = o2.startsWith("[") && o2.endsWith("]");
				if (ii1 && ii2) {
					return ELEMENT.compare(o1.substring(1, o1.length() - 1),
						o2.substring(1, o2.length() - 1));
				}
				if (ii1) {
					return -1;
				}
				if (ii2) {
					return 1;
				}
				return ATTRIBUTE.compare(o1, o2);
			}
Sort keys by element or index as appropriate, placing elements first.
Ghidra/Debug/Framework-TraceModeling/src/main/java/ghidra/trace/model/target/path/KeyPath.java