@Test
    public void testGetAddress() {
		try {
			SegmentedAddress addr = (SegmentedAddress) space.getAddress("12345");
			Assert.assertEquals(0x2345, addr.getSegmentOffset());
			Assert.assertEquals(0x1000, addr.getSegment());
			Assert.assertEquals(0x12345, addr.getOffset());

			addr = (SegmentedAddress) space.getAddress("1000:2345");

			Assert.assertEquals(0x2345, addr.getSegmentOffset());
			Assert.assertEquals(0x1000, addr.getSegment());
			Assert.assertEquals(0x12345, addr.getOffset());

			addr = (SegmentedAddress) space.getAddress("Test:12345");
			Assert.assertEquals(0x2345, addr.getSegmentOffset());
			Assert.assertEquals(0x1000, addr.getSegment());
			Assert.assertEquals(0x12345, addr.getOffset());

			addr = (SegmentedAddress) space.getAddress("Test:1000:2345");
			Assert.assertEquals(0x2345, addr.getSegmentOffset());
			Assert.assertEquals(0x1000, addr.getSegment());
			Assert.assertEquals(0x12345, addr.getOffset());

		}
		catch (AddressFormatException e) {
			Assert.fail(e.getMessage());
		}

		try {
			Address addr = space.getAddress(":10");
			assertNull(addr);

			addr = space.getAddress("Foo:0");
			assertNull(addr);

		}
		catch (AddressFormatException e) {
			Assert.fail(e.getMessage());
		}

		try {
			space.getAddress("3:ffffff");
			Assert.fail("Should not have given back an address!");
		}
		catch (AddressFormatException e) {
		}
		try {
			space.getAddress("Testxyz");
			Assert.fail("Should not have given back an address!");
		}
		catch (AddressFormatException e) {
		}
		try {
			space.getAddress("ffffff");
			Assert.fail("Should not have given back an address!");
		}
		catch (AddressFormatException e) {
		}
	}
To change this generated comment edit the template variable "typecomment":
Window>Preferences>Java>Templates.
Ghidra/Framework/SoftwareModeling/src/test/java/ghidra/program/model/address/SegmentedAddressSpaceTest.java