@Test
	public void testArrayElementReference() throws Exception {

		Address addr = addr(EXT_POINTERS_OFFSET);
		clearSymbols(addr, addr(EXT_POINTERS_OFFSET + 23));

		Command<Program> cmd = new CreateArrayCmd(addr, 6, new Pointer32DataType(), 4);
		cmd.applyTo(program);

		Symbol s = createLabel(addr, "ArrayA");
		s.setPrimary();

		ReferenceManager refMgr = program.getReferenceManager();
		for (int i = 0; i < 24; i += 4) {
			Address a = addr(EXT_POINTERS_OFFSET + i);
			ReferenceIterator iter = refMgr.getReferencesTo(a);
			while (iter.hasNext()) {
				Reference ref = iter.next();
				Instruction instr = program.getListing().getInstructionAt(ref.getFromAddress());
				assertNotNull(instr);
				int opIndex = ref.getOperandIndex();
				String opStr =
					CodeUnitFormat.DEFAULT.getOperandRepresentationString(instr, opIndex);
				if (i == 0) {
					assertEquals("[ArrayA]", opStr);
				}
				else {
					assertEquals("[ArrayA[" + i / 4 + "]]", opStr);
				}
			}
		}

	}
Sets up the fixture, for example, open a network connection.
This method is called before a test is executed.
Ghidra/Features/Base/src/test.slow/java/ghidra/app/plugin/core/data/DataReferencesTest.java