@Override
    public int hashCode()
    {
        if (frames.isEmpty()) {
            return 0;
        }

        int result = 1;
        for (ZFrame frame : frames) {
            result = 31 * result + (frame == null ? 0 : frame.hashCode());
        }

        return result;
    }
@Test
    public void testHashcode()
    {
        ZMsg msg = new ZMsg();
        assertThat(msg.hashCode(), is(0));

        msg.add("123");

        ZMsg other = ZMsg.newStringMsg("123");

        assertThat(msg.hashCode(), is(other.hashCode()));

        other = new ZMsg().append("2");

        assertThat(msg.hashCode(), is(not(equalTo(other.hashCode()))));
    }