@Test
    public void testMessageFrameManipulation() {
        ZMsg msg = new ZMsg();
        for (int i = 0; i < 10; i++)
            msg.addString("Frame" + i);

        // Remove all frames apart from the first and last one
        for (int i = 0; i < 8; i++) {
            Iterator<ZFrame> iter = msg.iterator();
            iter.next(); // Skip first frame
            ZFrame f = iter.next();
            msg.remove(f);
            f.destroy();
        }

        assertEquals(2, msg.size());
        assertEquals(12, msg.contentSize());
        assertTrue(msg.getFirst().streq("Frame0"));
        assertTrue(msg.getLast().streq("Frame9"));

        ZFrame f = new ZFrame("Address");
        msg.push(f);
        assertEquals(3, msg.size());
        assertTrue(msg.getFirst().streq("Address"));

        msg.addString("Body");
        assertEquals(4, msg.size());
        ZFrame f0 = msg.pop();
        assertTrue(f0.streq("Address"));

        msg.destroy();

        msg = new ZMsg();
        f = new ZFrame("Address");
        msg.wrap(f);
        assertEquals(2, msg.size());
        msg.addString("Body");
        assertEquals(3, msg.size());
        f = msg.unwrap();
        f.destroy();
        assertEquals(1, msg.size());
        msg.destroy();

    }