private Address getNextPreviousAddress(TaskMonitor monitor, Program program,
			Address address, boolean forward) {

		Address startAddress;
		byte[] bytes;
		CodeUnit cu = program.getListing().getCodeUnitContaining(address);
		if (cu != null) {
			try {
				bytes = cu.getBytes();
			}
			catch (MemoryAccessException e) {
				Msg.debug(this, "Exception getting code unit bytes at " + cu.getAddress(), e);
				return null; // not sure if this can happen
			}

			startAddress = forward ? cu.getMaxAddress().next() : cu.getMinAddress().previous();
		}
		else {
			try {
				Memory memory = program.getMemory();
				bytes = new byte[] { memory.getByte(address) };
			}
			catch (MemoryAccessException e) {
				Msg.debug(this, "Exception getting code unit bytes at " + address, e);
				return null; // not sure if this can happen
			}

			startAddress = forward ? address.next() : address.previous();
		}

		return getNextPreviousSameBytes(monitor, program, startAddress, bytes, forward);
	}
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