private boolean byteBlockSelectionEquals(ByteBlockSelection b1, ByteBlockSelection b2) {

		int nRanges = b1.getNumberOfRanges();
		if (nRanges != b2.getNumberOfRanges()) {
			return false;
		}
		for (int i = 0; i < nRanges; i++) {
			ByteBlockRange range1 = b1.getRange(i);
			ByteBlockRange range2 = b2.getRange(i);

			ByteBlock bb1 = range1.getByteBlock();
			ByteBlock bb2 = range2.getByteBlock();
			String start1 = bb1.getLocationRepresentation(range1.getStartIndex());
			String start2 = bb2.getLocationRepresentation(range2.getStartIndex());
			String end1 = bb1.getLocationRepresentation(range1.getEndIndex());
			String end2 = bb2.getLocationRepresentation(range2.getEndIndex());

			if (!start1.equals(start2) || !end1.equals(end2)) {
				return false;
			}
		}
		return true;
	}
Tests for two byte viewers connected.
Ghidra/Features/ByteViewer/src/test.slow/java/ghidra/app/plugin/core/byteviewer/ByteViewerConnectedToolBehaviorTest.java