public MeshMessage createMessage() {
        final Element element = mNrfMeshRepository.getSelectedElement().getValue();
        final MeshModel model = mNrfMeshRepository.getSelectedModel().getValue();
        if (element != null && model != null) {
            final AddressType type = MeshAddress.getAddressType(publishAddress);
            if (type != null && type != AddressType.VIRTUAL_ADDRESS) {
                return new ConfigModelPublicationSet(element.getElementAddress(),
                        publishAddress,
                        appKeyIndex,
                        friendshipCredentialsFlag,
                        publishTtl,
                        publicationSteps,
                        publicationResolution,
                        retransmitCount,
                        retransmitIntervalSteps,
                        model.getModelId());
            } else {
                return new ConfigModelPublicationVirtualAddressSet(element.getElementAddress(),
                        labelUUID,
                        appKeyIndex,
                        friendshipCredentialsFlag,
                        publishTtl,
                        publicationSteps,
                        publicationResolution,
                        retransmitCount,
                        retransmitIntervalSteps,
                        model.getModelId());
            }
        }
        return null;
    }
Creates the ConfigModelPublicationSet message depending on the address type
app/src/main/java/no/nordicsemi/android/nrfmesh/viewmodels/PublicationViewModel.java