@Test void onPeerStatus_shouldAddPeerToDifferentChain() { final SlotAndBlockRoot chainHead1 = dataStructureUtil.randomSlotAndBlockRoot(); final SlotAndBlockRoot chainHead2 = dataStructureUtil.randomSlotAndBlockRoot(); targetChains.onPeerStatusUpdated(peer1, chainHead1); targetChains.onPeerStatusUpdated(peer2, chainHead2); assertTargetChains(chainWith(chainHead1, peer1), chainWith(chainHead2, peer2)); }
public void onPeerStatusUpdated(final SyncSource peer, final SlotAndBlockRoot chainHead) { removePeerFromLastChain(peer); chains.computeIfAbsent(chainHead, TargetChain::new).addPeer(peer); lastPeerTarget.put(peer, chainHead); }
TargetChains { public void onPeerStatusUpdated(final SyncSource peer, final SlotAndBlockRoot chainHead) { removePeerFromLastChain(peer); chains.computeIfAbsent(chainHead, TargetChain::new).addPeer(peer); lastPeerTarget.put(peer, chainHead); } }
TargetChains { public void onPeerStatusUpdated(final SyncSource peer, final SlotAndBlockRoot chainHead) { removePeerFromLastChain(peer); chains.computeIfAbsent(chainHead, TargetChain::new).addPeer(peer); lastPeerTarget.put(peer, chainHead); }  }
TargetChains { public void onPeerStatusUpdated(final SyncSource peer, final SlotAndBlockRoot chainHead) { removePeerFromLastChain(peer); chains.computeIfAbsent(chainHead, TargetChain::new).addPeer(peer); lastPeerTarget.put(peer, chainHead); }  void onPeerStatusUpdated(final SyncSource peer, final SlotAndBlockRoot chainHead); void onPeerDisconnected(final SyncSource peer); Stream<TargetChain> streamChains(); }
TargetChains { public void onPeerStatusUpdated(final SyncSource peer, final SlotAndBlockRoot chainHead) { removePeerFromLastChain(peer); chains.computeIfAbsent(chainHead, TargetChain::new).addPeer(peer); lastPeerTarget.put(peer, chainHead); }  void onPeerStatusUpdated(final SyncSource peer, final SlotAndBlockRoot chainHead); void onPeerDisconnected(final SyncSource peer); Stream<TargetChain> streamChains();  }