### Question:
GeneralPacket implements IStreamPacket { @Override public void receivePacket(Queue<Pair<String, byte[]>> packets, byte[] data) throws Exception { MessageEnvelop recvMessage = (MessageEnvelop)deserialize(data); packets.add(new Pair<>( recvMessage.getMessageName(), serialize(recvMessage.getMessage()))); return; }  static GeneralPacket obj(); @Override void initSingletonInstance(); @Override ScenarioUnit decodeScenarioHeader(String packetHeader, ScenarioUnit scenarioUnit); @Override Object decodePacket(Class<?> clsPck, byte[] data); @Override byte[] getBodyPacket(byte[] packetBytes); @Override String packetToJson(Object packet); @Override GeneratedPacketJson packetToJson(String expect, Object real); @Override byte[] jsonToPacket(ScenarioUnit scenarioUnit); @Override void receivePacket(Queue<Pair<String, byte[]>> packets, byte[] data);  }### Answer:
@Test public void receivePacket() throws Exception { GeneralPacket generalPacket = new GeneralPacket(); BlockingQueue<Pair<String, byte[]>> packetQueue = new LinkedBlockingDeque<>(); GeneralPacket packet ; Pair<String, byte[]> decodedPacket = packetQueue.poll(); }