@Test
	public void testAdd() throws IOException {
		SharedRangeMapDB map = new SharedRangeMapDB(dbh, "TEST", this, true);

		// Add initial set of ranges
		map.add(10, 20, 1);
		map.add(30, 40, 1);
		map.add(50, 60, 1);
		map.add(70, 80, 1);

		IndexRange[] ranges = new IndexRange[] {
			new IndexRange(10, 20),
			new IndexRange(30, 40),
			new IndexRange(50, 60),
			new IndexRange(70, 80)
		};

		IndexRange[] entries = new IndexRange[] {
			new IndexRange(10, 1),
			new IndexRange(30, 1),
			new IndexRange(50, 1),
			new IndexRange(70, 1)
		};

		inspectRecords(map, ranges, entries);

		// Range already included
		map.add(52, 58, 1);
		map.add(52, 60, 1);
		map.add(50, 60, 1);

		inspectRecords(map, ranges, entries);

		// Add range
		map.add(21, 29, 1);

		ranges = new IndexRange[] {
			new IndexRange(10, 40),
			new IndexRange(50, 60),
			new IndexRange(70, 80)
		};

		entries = new IndexRange[] {
			new IndexRange(10, 1),
			new IndexRange(50, 1),
			new IndexRange(70, 1)
		};

		inspectRecords(map, ranges, entries);

		// Add range
		map.add(35, 55, 1);

		ranges = new IndexRange[] {
			new IndexRange(10, 60),
			new IndexRange(70, 80)
		};

		entries = new IndexRange[] {
			new IndexRange(10, 1),
			new IndexRange(70, 1)
		};

		inspectRecords(map, ranges, entries);

		// Add range
		map.add(55, 90, 1);

		ranges = new IndexRange[] {
			new IndexRange(10, 90)
		};

		entries = new IndexRange[] {
			new IndexRange(10, 1)
		};

		inspectRecords(map, ranges, entries);

		// Add second overlapped value
		map.add(20, 30, 2);

		ranges = new IndexRange[] {
			new IndexRange(10, 19),
			new IndexRange(20, 30),
			new IndexRange(31, 90)
		};

		entries = new IndexRange[] {
			new IndexRange(10, 1),
			new IndexRange(20, 1),
			new IndexRange(31, 1),
			new IndexRange(20, 2)
		};

		inspectRecords(map, ranges, entries);

		// Add third overlapped value
		map.add(28, 35, 3);

		ranges = new IndexRange[] {
			new IndexRange(10, 19),
			new IndexRange(20, 27),
			new IndexRange(28, 30),
			new IndexRange(31, 35),
			new IndexRange(36, 90)
		};

		entries = new IndexRange[] {
			new IndexRange(10, 1),
			new IndexRange(20, 1),
			new IndexRange(28, 1),
			new IndexRange(31, 1),
			new IndexRange(36, 1),
			new IndexRange(20, 2),
			new IndexRange(28, 2),
			new IndexRange(28, 3),
			new IndexRange(31, 3)
		};

		inspectRecords(map, ranges, entries);

		// Add fourth overlapped value
		map.add(28, 35, 4);

		ranges = new IndexRange[] {
			new IndexRange(10, 19),
			new IndexRange(20, 27),
			new IndexRange(28, 30),
			new IndexRange(31, 35),
			new IndexRange(36, 90)
		};

		entries = new IndexRange[] {
			new IndexRange(10, 1),
			new IndexRange(20, 1),
			new IndexRange(28, 1),
			new IndexRange(31, 1),
			new IndexRange(36, 1),
			new IndexRange(20, 2),
			new IndexRange(28, 2),
			new IndexRange(28, 3),
			new IndexRange(31, 3),
			new IndexRange(28, 4),
			new IndexRange(31, 4)
		};

		inspectRecords(map, ranges, entries);

		// Expand fourth overlapped value range
		map.add(25, 39, 4);

		ranges = new IndexRange[] {
			new IndexRange(10, 19),
			new IndexRange(20, 24),
			new IndexRange(25, 27),
			new IndexRange(28, 30),
			new IndexRange(31, 35),
			new IndexRange(36, 39),
			new IndexRange(40, 90)
		};

		entries = new IndexRange[] {
			new IndexRange(10, 1),
			new IndexRange(20, 1),
			new IndexRange(25, 1),
			new IndexRange(28, 1),
			new IndexRange(31, 1),
			new IndexRange(36, 1),
			new IndexRange(40, 1),
			new IndexRange(20, 2),
			new IndexRange(25, 2),
			new IndexRange(28, 2),
			new IndexRange(28, 3),
			new IndexRange(31, 3),
			new IndexRange(25, 4),
			new IndexRange(28, 4),
			new IndexRange(31, 4),
			new IndexRange(36, 4)
		};

		inspectRecords(map, ranges, entries);
	}
Crude inspection - assumes two records will not contain the same
content.
@param map
@param ranges
@param mapRangeToValue (from is rangeKey, to is value)
@throws IOException
Ghidra/Features/Base/src/test.slow/java/ghidra/program/database/util/SharedRangeMapDBTest.java