@Programmatic
    public PostalAddress findByAddress(
            final CommunicationChannelOwner owner, 
            final String address1, 
            final String postalCode, 
            final String city, 
            final Country country) {

        final List<CommunicationChannelOwnerLink> links =
                communicationChannelOwnerLinkRepository.findByOwnerAndCommunicationChannelType(owner, CommunicationChannelType.POSTAL_ADDRESS);
        final Iterable<PostalAddress> postalAddresses =
                Iterables.transform(
                        links,
                        CommunicationChannelOwnerLink.Functions.communicationChannel(PostalAddress.class));
        final Optional<PostalAddress> postalAddressIfFound =
                Iterables.tryFind(postalAddresses, PostalAddress.Predicates.equalTo(address1, postalCode, city, country));
        return postalAddressIfFound.orNull();
    }
@ Programmatic public PostalAddress findByAddress ( final CommunicationChannelOwner owner , final String address1 , final String postalCode , final String city , final Country country ) { final List < CommunicationChannelOwnerLink > links = communicationChannelOwnerLinkRepository . findByOwnerAndCommunicationChannelType ( owner , CommunicationChannelType . POSTAL_ADDRESS ) ; final Iterable < PostalAddress > postalAddresses = Iterables . transform ( links , CommunicationChannelOwnerLink . Functions . communicationChannel ( PostalAddress . class ) ) ; final Optional < PostalAddress > postalAddressIfFound = Iterables . tryFind ( postalAddresses , PostalAddress . Predicates . equalTo ( address1 , postalCode , city , country ) ) ; return postalAddressIfFound . orNull ( ) ; }
//////////////////////////////////////