private List<Register> getUniqueRegisters() {
	
		ArrayList<Register> regs = new ArrayList<>(context.getRegisters());
		Collections.sort(regs, new Comparator<Register>() {
			@Override
			public int compare(Register r1, Register r2) {
				int size1 = r1.getMinimumByteSize();
				int size2 = r2.getMinimumByteSize();
				if (size1 != size2) {
					return size1 - size2;	
				}
				return r1.getOffset() - r2.getOffset(); 
			}
		});
		
		return regs;
	}
Returns list of unique registers which do not overlap any smaller 
registers.
Ghidra/Features/Base/src/main/java/ghidra/app/util/xml/RegisterValuesXmlMgr.java