@Test void firstRoundWithThreePeers() { EphemeralPeerRepository repo = new EphemeralPeerRepository(); State state = new State(repo, Hash::keccak256, new MockMessageSender(), messageRef::set, (message, peer) -> true); state.addPeer(new PeerImpl()); state.addPeer(new PeerImpl()); state.addPeer(new PeerImpl()); assertTrue(repo.lazyPushPeers().isEmpty()); assertEquals(3, repo.eagerPushPeers().size()); }
public void addPeer(Peer peer) { peerRepository.addEager(peer); }
State { public void addPeer(Peer peer) { peerRepository.addEager(peer); } }
State { public void addPeer(Peer peer) { peerRepository.addEager(peer); } State(
      PeerRepository peerRepository,
      MessageHashing messageHashingFunction,
      MessageSender messageSender,
      Consumer<Bytes> messageListener,
      MessageValidator messageValidator);  State(
      PeerRepository peerRepository,
      MessageHashing messageHashingFunction,
      MessageSender messageSender,
      Consumer<Bytes> messageListener,
      MessageValidator messageValidator,
      long graftDelay,
      long lazyQueueInterval); }
State { public void addPeer(Peer peer) { peerRepository.addEager(peer); } State(
      PeerRepository peerRepository,
      MessageHashing messageHashingFunction,
      MessageSender messageSender,
      Consumer<Bytes> messageListener,
      MessageValidator messageValidator);  State(
      PeerRepository peerRepository,
      MessageHashing messageHashingFunction,
      MessageSender messageSender,
      Consumer<Bytes> messageListener,
      MessageValidator messageValidator,
      long graftDelay,
      long lazyQueueInterval); void addPeer(Peer peer); void removePeer(Peer peer); void receiveGossipMessage(Peer peer, Bytes message); void receiveIHaveMessage(Peer peer, Bytes messageHash); void receivePruneMessage(Peer peer); void receiveGraftMessage(Peer peer, Bytes messageHash); void sendGossipMessage(Bytes message); void stop(); }
State { public void addPeer(Peer peer) { peerRepository.addEager(peer); } State(
      PeerRepository peerRepository,
      MessageHashing messageHashingFunction,
      MessageSender messageSender,
      Consumer<Bytes> messageListener,
      MessageValidator messageValidator);  State(
      PeerRepository peerRepository,
      MessageHashing messageHashingFunction,
      MessageSender messageSender,
      Consumer<Bytes> messageListener,
      MessageValidator messageValidator,
      long graftDelay,
      long lazyQueueInterval); void addPeer(Peer peer); void removePeer(Peer peer); void receiveGossipMessage(Peer peer, Bytes message); void receiveIHaveMessage(Peer peer, Bytes messageHash); void receivePruneMessage(Peer peer); void receiveGraftMessage(Peer peer, Bytes messageHash); void sendGossipMessage(Bytes message); void stop();  }