public static Data getNextNonUndefinedDataAfter(Program program, Address addr,
			Address maxAddr) {
		// get the next non undefined data element in memory
		Listing listing = program.getListing();
		Address currentAddress = addr;
		Data data = listing.getDefinedDataAfter(currentAddress);
		// Ignore all sized Undefined data types.
		while ((data != null) && (Undefined.isUndefined(data.getDataType())) &&
			currentAddress.compareTo(maxAddr) <= 0) {
			currentAddress = data.getMaxAddress();
			data = listing.getDefinedDataAfter(currentAddress);
		}
		if ((data != null) && (data.getAddress().compareTo(maxAddr) > 0)) {
			return null;
		}
		return data;
	}
Get the next defined data that comes after the address indicated by addr and that is
no more than the specified maxAddr and that is not a sized undefined data type.
@param program the program whose code units are to be checked to find the next
non-undefined data.
@param addr start looking for data after this address.
@param maxAddr do not look any further than this address.
@return the next defined data that isn't a sized undefined data type, or return null if
there isn't one.
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/DataUtilities.java