@Nonnull
    static String constructLookup(@Nonnull final String service, @Nonnull final String proto, @Nonnull final String name)
    {
        String lookup = "";
        if ( !service.startsWith( "_" ) )
        {
            lookup += "_";
        }
        lookup += service;

        if ( !lookup.endsWith( "." ) )
        {
            lookup += ".";
        }

        if ( !proto.startsWith( "_" ) )
        {
            lookup += "_";
        }
        lookup += proto;

        if ( !lookup.endsWith( "." ) )
        {
            lookup += ".";
        }

        lookup += name;
        if ( !lookup.endsWith( "." ) ) {
            lookup += ".";
        }

        return lookup.toLowerCase();
    }
@Test
    public void testConstructLookup() throws Exception
    {
        // Setup test fixture.
        final String service = "xmpp-client";
        final String protocol = "tcp";
        final String name = "igniterealtime.org";

        // Execute system under test.
        final String result = DNSUtil.constructLookup(service, protocol, name);

        // Verify results.
        assertEquals("_xmpp-client._tcp.igniterealtime.org.", result);
    }