BGPv4PacketDecoder { private KeepalivePacket decodeKeepalivePacket(ChannelBuffer buffer) { KeepalivePacket packet = new KeepalivePacket(); ProtocolPacketUtils.verifyPacketSize(buffer, BGPv4Constants.BGP_PACKET_SIZE_KEEPALIVE, BGPv4Constants.BGP_PACKET_SIZE_KEEPALIVE); return packet; }  BGPv4Packet decodePacket(ChannelBuffer buffer);  }
@Test public void testDecodeKeepalivePacket() { KeepalivePacket keep = safeDowncast(decoder.decodePacket(buildProtocolPacket(new byte[] { (byte)0x04, })), KeepalivePacket.class); Assert.assertNotNull(keep); }