private Address getNextPreviousDifferentByteValueAddress(TaskMonitor monitor, Program program,
			Address address, boolean forward) throws CancelledException {
		byte value = 0;
		try {
			value = program.getMemory().getByte(address);
		}
		catch (MemoryAccessException e) {
			CodeUnit codeUnit = getNextPreviousCodeUnit(program, address, forward);
			return codeUnit == null ? null : codeUnit.getAddress();
		}

		// make sure we go at least to the next code unit
		CodeUnit cu = program.getListing().getCodeUnitContaining(address);
		if (cu != null) {
			address = forward ? cu.getMaxAddress() : cu.getMinAddress();
		}

		AddressSetView initialized = program.getMemory().getAllInitializedAddressSet();
		Iterator<Address> iterator = initialized.getAddresses(address, forward);
		iterator.next();
		Memory memory = program.getMemory();
		while (iterator.hasNext()) {
			monitor.checkCancelled();
			Address addr = iterator.next();
			try {
				byte testByte = memory.getByte(addr);
				if (testByte != value) {
					return addr;
				}
			}
			catch (MemoryAccessException e) {
				// should not happen as we are only iterating over "initialized memory"
				throw new AssertException(
					"Got MemoryAccessException when iterating over intialized memeory!");
			}
		}
		return null;
	}
Navigates to the same byte pattern value under the current code unit.  When negated, the search
will only consider a single byte, as it seems more useful to be able to skip runs of a 
particular byte.
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/navigation/NextPreviousSameBytesAction.java