    @Test
    public void testReplyPacket() throws IOException {

        byte[] packet = createReplyPacket();
        Result r = decode(packet, packet.length);

        // check A record
        assertEquals("192.168.1.100", r.a.ipaddr);
        assertEquals("dev0123456789.local", r.a.fqdn);
        assertEquals(10, r.a.ttl);

        // check SRV record
        assertEquals(0, r.srv.priority);
        assertEquals(0, r.srv.weight);
        assertEquals(1234, r.srv.port);
        assertEquals("dev0123456789.local", r.srv.target);
        assertEquals("device-1234._example._tcp.local", r.srv.fqdn);
        assertEquals(10, r.srv.ttl);

        // check TXT record
        Map<String, String> expectedTxt = new HashMap<>();
        expectedTxt.put("foo", "bar");
        expectedTxt.put("bar", null);
        expectedTxt.put("txtvers", "1");
        assertEquals(expectedTxt, r.txt.dict);
        assertEquals("device-1234._example._tcp.local", r.txt.fqdn);
        assertEquals(10, r.txt.ttl);
    }