### Question:
QueueDelete extends MethodFrame { @Override protected void writeMethod(ByteBuf buf) { buf.writeShort(0); queue.write(buf); int flags = 0x00; if (ifUnused) { flags |= 0x1; } if (ifEmpty) { flags |= 0x2; } if (noWait) { flags |= 0x4; } buf.writeByte(flags); } QueueDelete(int channel, ShortString queue, boolean ifUnused, boolean ifEmpty, boolean noWait); @Override void handle(ChannelHandlerContext ctx, AmqpConnectionHandler connectionHandler); static AmqMethodBodyFactory getFactory();  }### Answer:
@Test (dataProvider = "QueueDeleteParams") public void testWriteMethod(String name, boolean ifUnused, boolean ifEmpty, boolean noWait) throws Exception { ShortString queueName = ShortString.parseString(name); QueueDelete frame = new QueueDelete(1, queueName, ifUnused, ifEmpty, noWait); long expectedSize = 2L + queueName.getSize() + 1L; Assert.assertEquals(frame.getMethodBodySize(), expectedSize, "Expected frame size mismatch"); ByteBuf buffer = Unpooled.buffer((int) expectedSize); frame.writeMethod(buffer); buffer.skipBytes(2); Assert.assertEquals(ShortString.parse(buffer), queueName); short flags = buffer.readByte(); Assert.assertEquals(ifUnused, (flags & 0x1) == 0x1); Assert.assertEquals(ifEmpty, (flags & 0x2) == 0x2); Assert.assertEquals(noWait, (flags & 0x4) == 0x4); }