@Test
	public void testStructures() throws Exception {

		showTool(tool);
		Structure struct = new StructureDataType("aStruct", 0);
		DataType floatDt = new FloatDataType();
		DataTypeComponent dtc = struct.add(floatDt);
		dtc = struct.add(floatDt);
		dtc.setComment("this is another float");
		Listing listing = program.getListing();

		int transactionID = program.startTransaction("test");
		try {
			DataType dt = program.getDataTypeManager()
					.addDataType(struct, DataTypeConflictHandler.DEFAULT_HANDLER);
			floatDt = program.getDataTypeManager()
					.addDataType(new FloatDataType(), DataTypeConflictHandler.DEFAULT_HANDLER);
			listing.createData(addr(0x0100689b), dt);
			listing.createData(addr(0x0100688c), floatDt);
			listing.createData(addr(0x01006890), floatDt);

			Data data = listing.getDataAt(addr(0x0100688c));
			data.setComment(CommentType.EOL, "this is a float data type");
			data = listing.getDataAt(addr(0x01006890));
			data.setComment(CommentType.EOL, "this is another float data type");

		}
		finally {
			program.endTransaction(transactionID, true);
		}
		// open the structure
		cb.goToField(addr(0x0100689b), "+", 0, 0);
		click(cb, 1);
		waitForSwing();

		ProgramSelection sel = new ProgramSelection(addr(0x0100688c), addr(0x010068a3));
		tool.firePluginEvent(new ProgramSelectionPluginEvent("test", sel, program));

		//search mnemonics and operands
		SearchOptions options = new SearchOptions("float", false /*quick*/, false /*functions*/,
			false /*comments*/, false /*labels*/, true /*instruction mnemonics*/,
			true /*instruction operands*/, true /*data mnemonics*/, true /*data operands*/,
			false /*case sensitive*/, true /*is forward*/, false, false);
		ProgramLocation startLoc = new AddressFieldLocation(program, addr(0x0100688c));
		searcher =
			new ListingDisplaySearcher(tool, program, startLoc, sel, options, TaskMonitor.DUMMY);

		//set up list of answers
		ArrayList<Address> startList = new ArrayList<>();
		startList.add(addr(0x0100688c));
		startList.add(addr(0x01006890));
		startList.add(addr(0x0100689b));
		startList.add(addr(0x0100689f));

		//check that the text is found there in the correct field
		checkTextFound(startList, MnemonicFieldLocation.class);

		//now search comments
		options = new SearchOptions("float", false /*quick*/, false /*functions*/,
			true /*comments*/, false /*labels*/, false /*instruction mnemonics*/,
			false /*instruction operands*/, false /*data mnemonics*/, false /*data operands*/,
			false /*case sensitive*/, true /*is forward*/, false, false);
		startLoc = new AddressFieldLocation(program, addr(0x0100688c));
		searcher =
			new ListingDisplaySearcher(tool, program, startLoc, sel, options, TaskMonitor.DUMMY);

		//remove the one without a comment

		ArrayList<Address> startList2 = new ArrayList<>();
		startList2.add(addr(0x0100688c));
		startList2.add(addr(0x01006890));
		startList2.add(addr(0x0100689f));

		//check that the text is found there in the correct field
		checkTextFound(startList2, EolCommentFieldLocation.class); //waiting for Bill to fix the search
	}
Test the searcher that searches fields in the Code Browser
Ghidra/Features/Base/src/test.slow/java/ghidra/app/plugin/core/searchtext/ListingDisplaySearcherTest.java