public List<IncomingPacket> getIncomingPackets() {
    final List<IncomingPacket> packets =
        Arrays.asList(incomingPackets.toArray(new IncomingPacket[0]));
    incomingPackets.clear();
    return packets;
  }
Get and clear the list of any incoming packets to this agent.

@return A list of packets received by this agent
ethereum/p2p/src/test/java/org/hyperledger/besu/ethereum/p2p/discovery/internal/MockPeerDiscoveryAgent.java