public AddressType getAddressType(Address address) {
		if (listing == null || address == null) {
			return AddressType.UNINITIALIZED;
		}

		if (isInFunction(address)) {
			return AddressType.FUNCTION;
		}

		CodeUnit codeUnit = listing.getCodeUnitContaining(address);

		if (codeUnit == null) {
			return AddressType.UNINITIALIZED;
		}

		if (hasExternalReference(codeUnit)) {
			return AddressType.EXTERNAL_REF;
		}

		if (codeUnit instanceof Instruction) {
			return AddressType.INSTRUCTION;
		}

		if (codeUnit instanceof Data && ((Data) codeUnit).isDefined()) {
			return AddressType.DATA;
		}

		if (isInInitializedBlock(address)) {
			return AddressType.UNDEFINED;
		}

		return AddressType.UNINITIALIZED;
	}
Determines the {@link AddressType} for the given address

@param address the address for which to get an AddressType.
@return the {@link AddressType} for the given address.
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/overview/addresstype/AddressTypeOverviewColorService.java