@Override
	public int compare(Object o1, Object o2) {

		String name1, name2;
		if (o1 instanceof DataType && o2 instanceof DataType) {
			DataType dt1 = (DataType) o1;
			name1 = dt1.getName();
			DataType dt2 = (DataType) o2;
			name2 = dt2.getName();
		}
		// these cases are for lookups by string keys        
		else if (o1 instanceof String && o2 instanceof DataType) {
			name1 = (String) o1;
			DataType dt2 = (DataType) o2;
			name2 = dt2.getName();
		}
		else if (o1 instanceof DataType && o2 instanceof String) {
			DataType dt1 = (DataType) o1;
			name1 = dt1.getName();
			name2 = (String) o2;
		}
		else if (o1 instanceof String && o2 instanceof String) {
			name1 = (String) o1;
			name2 = (String) o2;
		}
		else {
			throw new IllegalArgumentException("Unsupported comparison " +
				o1.getClass().getSimpleName() + " / " + o2.getClass().getSimpleName());
		}
		return DataTypeNameComparator.INSTANCE.compare(name1, name2);
	}
Compare two data type names
@param o1 the first {@link DataType} or {@link String} name to be compared.
@param o2 the second {@link DataType} or {@link String} name to be compared.
@return a negative integer, zero, or a positive integer as the
        first argument is less than, equal to, or greater than the
        second.
@throws IllegalArgumentException if object types other than {@link DataType} or 
{@link String} are compared.
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/DataTypeObjectComparator.java