private List<DockingActionIf> getActionsForCodeUnitAndType(Address primaryAddress, String type,
			BookmarkNavigator navigator) {

		// find all bookmarks that may be within the code unit at address
		List<DockingActionIf> actionList = new ArrayList<>();
		CodeUnit cu = currentProgram.getListing().getCodeUnitContaining(primaryAddress);
		if (cu == null) {
			return actionList;
		}
		Address start = cu.getMinAddress();
		Address end = cu.getMaxAddress();

		if (!navigator.intersects(start, end)) {
			return actionList;
		}

		for (int i = 1; i < cu.getLength(); i++) {
			Address nextCodeUnitAddress = start.add(i);
			if (!nextCodeUnitAddress.equals(primaryAddress)) { // skip the original location                    
				Bookmark[] otherBookmarks = bookmarkMgr.getBookmarks(nextCodeUnitAddress, type);
				if (otherBookmarks.length > 0) {
					DockingAction action = new DeleteBookmarkAction(this, otherBookmarks[0], true);
					action.setEnabled(true);
					actionList.add(action);
				}
			}
		}
		return actionList;
	}
Returns a list of actions to delete bookmarks that are in the code unit surrounding the given
address <b>for the given <i>type</i> of bookmark</b>.

@param primaryAddress The address required to find the containing code unit.
@param type The bookmark type to retrieve.
@param navigator The BookmarkNavigator used to determine whether there are bookmarks inside
           the code unit containing the given {@code primaryAddress}.
@return a list of actions to delete bookmarks that are in the code unit surrounding the given
        address <b>for the given <i>type</i> of bookmark</b>.
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/bookmark/BookmarkPlugin.java