private boolean hasTrailingUndefined(Data data, DataType replacementDT) {
		Address address = data.getAddress();
		return DataUtilities.isUndefinedRange(program, address.add(data.getLength()),
			address.add(replacementDT.getLength() - 1));
	}
Logic to test if a Data instance is replaceable with a data type.
Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/dwarf/DWARFDataInstanceHelper.java