@Test
	public void testConditionalJumpOverride() throws AddressFormatException {
		//verify the instructions needed for the test
		Address condJumpAddr = defaultSpace.getAddress(CONDITIONAL_JUMP_100016);
		Instruction condJump = program.getListing().getInstructionAt(condJumpAddr);
		assertNotNull(condJump);
		assertEquals("breq 0x0010001a", condJump.toString());
		Address addAddr = defaultSpace.getAddress(ADD_R0_R0_100018);
		Instruction add = program.getListing().getInstructionAt(addAddr);
		assertNotNull(add);
		assertEquals("add r0,r0", add.toString());
		Address subAddr = defaultSpace.getAddress(SUB_R0_R0_10001a);
		Instruction sub = program.getListing().getInstructionAt(subAddr);
		assertNotNull(sub);
		assertEquals("sub r0,r0", sub.toString());

		//verify unmodified pcode
		PcodeOp[] noRef = condJump.getPcode(false);
		assertTrue(noRef.length == 3);
		assertTrue(noRef[0].getOpcode() == PcodeOp.BOOL_NEGATE); //negate condition
		assertTrue(noRef[1].getOpcode() == PcodeOp.CBRANCH);     //CBRANCH to inst_next
		assertTrue(noRef[2].getOpcode() == PcodeOp.BRANCH);      //BRANCH to 0x10001a

		//verify that requesting overrides when there are none is the same as not 
		//requesting overriders
		assertTrue(equalPcodeOpArrays(condJump.getPcode(true), condJump.getPcode(false)));

		//create non-primary overriding reference
		int id = program.startTransaction("test");
		Reference overrideRef = refManager.addMemoryReference(condJumpAddr, func2Addr,
			RefType.JUMP_OVERRIDE_UNCONDITIONAL, SourceType.USER_DEFINED, -1);
		refManager.setPrimary(overrideRef, false);
		program.endTransaction(id, true);

		//verify that pcode is unchanged
		assertTrue(equalPcodeOpArrays(noRef, condJump.getPcode()));
		assertTrue(equalPcodeOpArrays(noRef, condJump.getPcode(false)));
		assertTrue(equalPcodeOpArrays(noRef, condJump.getPcode(true)));

		//set the reference to primary
		id = program.startTransaction("test");
		refManager.setPrimary(overrideRef, true);
		program.endTransaction(id, true);

		//verify that nothing changes if no overrides are requested
		assertTrue(equalPcodeOpArrays(noRef, condJump.getPcode(false)));
		assertTrue(equalPcodeOpArrays(noRef, condJump.getPcode()));

		PcodeOp[] overridden = condJump.getPcode(true);
		//verify that the CBRANCH op has been changed and that no other ops have changed
		assertTrue(overridden.length == noRef.length);
		assertTrue(equalPcodeOps(noRef[0], overridden[0]));
		assertNull(overridden[1].getOutput());
		assertTrue(overridden[1].getOpcode() == PcodeOp.BRANCH);
		assertTrue(overridden[1].getInput(0).isAddress());
		assertTrue(overridden[1].getInput(0).getOffset() == func2Addr.getOffset());

		//note: the 2nd input is left over from the CBRANCH op and should probably be destroyed
		assertTrue(overridden[1].getNumInputs() == 2);
		assertTrue(equalPcodeOps(noRef[2], overridden[2]));

		//apply another primary reference, no overrides should occur
		id = program.startTransaction("test");
		overrideRef = refManager.addMemoryReference(condJumpAddr, func1Addr,
			RefType.JUMP_OVERRIDE_UNCONDITIONAL, SourceType.USER_DEFINED, 0);
		refManager.setPrimary(overrideRef, true);
		program.endTransaction(id, true);

		assertTrue(equalPcodeOpArrays(noRef, condJump.getPcode(true)));
		assertTrue(equalPcodeOpArrays(noRef, condJump.getPcode(false)));
		assertTrue(equalPcodeOpArrays(noRef, condJump.getPcode()));
	}
Tests that a single primary JUMP_OVERRIDE_UNCONDITIONAL reference:
 1) changes a CBRANCH op to a BRANCH op 
 2) changes the jump target
@throws AddressFormatException if {@code AddressSpace.getAddress} throws it
Ghidra/Test/IntegrationTest/src/test.slow/java/ghidra/program/model/pcode/PcodeEmitContextTest.java