@Test
	public void testCallotherJumpOverride() throws AddressFormatException {
		//verify the instructions needed for the test
		Address userTwoAddr = defaultSpace.getAddress(USER_TWO_R0_100020);
		Instruction userTwo = program.getListing().getInstructionAt(userTwoAddr);
		assertNotNull(userTwo);
		assertEquals("user_two r0", userTwo.toString());

		PcodeOp[] unmodified = userTwo.getPcode(false);
		assertNull(unmodified[0].getOutput());
		assertTrue(unmodified[0].getOpcode() == PcodeOp.CALLOTHER); //pcodeop_two(rs)
		assertTrue(unmodified[0].getNumInputs() == 2);              //callother op index, rs
		assertNull(unmodified[1].getOutput());
		assertTrue(unmodified[1].getOpcode() == PcodeOp.CALLOTHER); //pcodeop_three()
		assertTrue(unmodified[1].getNumInputs() == 1);              //callother op index

		//lay down CALLOTHER_OVERRIDE_JUMP ref as non-primary
		int id = program.startTransaction("test");
		Reference callotherOverrideJump1 = refManager.addMemoryReference(userTwoAddr, func1Addr,
			RefType.CALLOTHER_OVERRIDE_JUMP, SourceType.USER_DEFINED, -1);
		refManager.setPrimary(callotherOverrideJump1, false);
		program.endTransaction(id, true);

		//nothing should change regardless of whether overrides are requested
		assertTrue(equalPcodeOpArrays(unmodified, userTwo.getPcode()));
		assertTrue(equalPcodeOpArrays(unmodified, userTwo.getPcode(false)));
		assertTrue(equalPcodeOpArrays(unmodified, userTwo.getPcode(true)));

		//make the reference primary
		id = program.startTransaction("test");
		refManager.setPrimary(callotherOverrideJump1, true);
		program.endTransaction(id, true);

		//nothing should change without overrides
		assertTrue(equalPcodeOpArrays(unmodified, userTwo.getPcode()));
		assertTrue(equalPcodeOpArrays(unmodified, userTwo.getPcode(false)));

		PcodeOp[] modified = userTwo.getPcode(true);
		//verify first CALLOTHER changed to a BRANCH
		assertNull(modified[0].getOutput());
		assertTrue(modified[0].getOpcode() == PcodeOp.BRANCH);
		assertTrue(modified[0].getNumInputs() == 2); //should probably destroy second input...
		assertTrue(modified[0].getInput(0).isAddress());
		assertTrue(modified[0].getInput(0).getOffset() == func1Addr.getOffset());
		//verify that second CALLOTHER not changed
		assertTrue(equalPcodeOps(unmodified[1], modified[1]));

		//add a primary JUMP_OVERRIDE_UNCONDITIONAL reference
		id = program.startTransaction("test");
		Reference jumpOverrideRef = refManager.addMemoryReference(userTwoAddr, func2Addr,
			RefType.JUMP_OVERRIDE_UNCONDITIONAL, SourceType.USER_DEFINED, 0);
		refManager.setPrimary(jumpOverrideRef, true);
		program.endTransaction(id, true);

		//nothing should change without overrides
		assertTrue(equalPcodeOpArrays(unmodified, userTwo.getPcode()));
		assertTrue(equalPcodeOpArrays(unmodified, userTwo.getPcode(false)));

		//with overrides, jumpOverrideRef should not do anything
		assertTrue(equalPcodeOpArrays(modified, userTwo.getPcode(true)));

		//set a primary CALLOTHER_OVERRIDE_CALL reference at the same address
		//delete jumpOverrideRef
		id = program.startTransaction("test");
		Reference callotherOverrideCall2 = refManager.addMemoryReference(userTwoAddr, func1Addr,
			RefType.CALLOTHER_OVERRIDE_CALL, SourceType.USER_DEFINED, 0);
		refManager.delete(jumpOverrideRef);
		refManager.setPrimary(callotherOverrideCall2, true);
		program.endTransaction(id, true);

		//verify that the CALLOTHER_OVERRIDE_CALL reference has precedence
		PcodeOp[] precedence = userTwo.getPcode(true);
		assertNull(precedence[0].getOutput());
		assertTrue(precedence[0].getOpcode() == PcodeOp.CALL);
		assertTrue(precedence[0].getNumInputs() == 1);
		assertTrue(precedence[0].getInput(0).isAddress());
		assertTrue(precedence[0].getInput(0).getOffset() == func1Addr.getOffset());
		assertTrue(equalPcodeOps(precedence[1], unmodified[1]));

		//nothing should change without overrides
		assertTrue(equalPcodeOpArrays(unmodified, userTwo.getPcode()));
		assertTrue(equalPcodeOpArrays(unmodified, userTwo.getPcode(false)));

		//add another primary CALL_OVERRIDE_JUMP reference and set the
		//CALLOTHER_OVERRIDE_CALL ref to non-primary
		id = program.startTransaction("test");
		Reference callotherOverrideJump3 = refManager.addMemoryReference(userTwoAddr, func1Addr,
			RefType.CALLOTHER_OVERRIDE_JUMP, SourceType.USER_DEFINED, 0);
		refManager.setPrimary(callotherOverrideCall2, false);
		refManager.setPrimary(callotherOverrideJump3, true);
		program.endTransaction(id, true);

		//verify that nothing changes, with or without requesting overrides
		assertTrue(equalPcodeOpArrays(unmodified, userTwo.getPcode()));
		assertTrue(equalPcodeOpArrays(unmodified, userTwo.getPcode(false)));
		assertTrue(equalPcodeOpArrays(unmodified, userTwo.getPcode(true)));
	}
Tests that a single primary CALLOTHER_OVERRIDE_JUMP reference:
  1) Changes the first CALLOTHER op encountered as follows:
    a) CALLOTHER op -> BRANCH op
    b) new BRANCH op not affected by JUMP_OVERRIDE_UNCONDITIONAL references
    c) input 0 becomes the branch target
    d) other inputs untouched
  2) Does not change subsequent CALLOTHER ops corresponding to the same instruction
  3) Is pre-empted by a single primary CALLOTHER_OVERRIDE_CALL reference
@throws AddressFormatException if {@code AddressSpace.getAddress()} throws it
Ghidra/Test/IntegrationTest/src/test.slow/java/ghidra/program/model/pcode/PcodeEmitContextTest.java