private Address getNextAddress(Address address, boolean after) {

			// Assume only a single external location is ever displayed within a panel
			if (address.isExternalAddress()) {
				return null;
			}

			Address nextAddress = null; // Next address for this model
			Program program = getProgram();
			Program primaryProgram = models[0].getProgram();
			Address primaryModelAddress = (program == primaryProgram) ? address
					: SimpleDiffUtility.getCompatibleAddress(program, address, primaryProgram);

			if (primaryModelAddress == null) {
				return null;
			}

			// Important: These models can be from different programs, so must convert addresses
			for (ListingModel tempModel : models) {
				Address tempModelAddressAfter =
					after ? tempModel.getAddressAfter(primaryModelAddress)
							: tempModel.getAddressBefore(primaryModelAddress);

				// Convert the tempModelAddress back to address for this model so it can be compared
				Program tempModelProgram = tempModel.getProgram();
				Address addressAfter = (program == tempModelProgram) ? tempModelAddressAfter
						: SimpleDiffUtility.getCompatibleAddress(tempModelProgram,
							tempModelAddressAfter, program);

				if (addressAfter == null) {
					continue;
				}

				if (nextAddress == null) {
					nextAddress = addressAfter;
					continue;
				}

				int result = addressAfter.compareTo(nextAddress);
				boolean isNextAddress = after ? result < 0 : result > 0;
				if (isNextAddress) {
					nextAddress = addressAfter;
				}
			}
			return nextAddress;
		}
Returns the next address in the specified direction

@param address the start address
@param after true to find the address after the given address; false to find the 
		  address before the given address
@return the next address in the given direction; null if there is no next address or if
        <code>address</code> is null
Ghidra/Features/Base/src/main/java/ghidra/app/util/viewer/multilisting/MultiListingLayoutModel.java