private void splitPeerList(){
  List<Peer> newIncoming=new ArrayList<>();
  List<Peer> newOutgoing=new ArrayList<>();
  for (  Peer peer : peerList) {
    if (peer.hasReceivedData()) {
      newIncoming.add(peer);
    }
 else {
      newOutgoing.add(peer);
    }
  }
  boolean changed=false;
  if (!newIncoming.equals(incomingList)) {
    changed=true;
    incomingList.clear();
    incomingList.addAll(newIncoming);
  }
  if (!newOutgoing.equals(outgoingList)) {
    changed=true;
    outgoingList.clear();
    outgoingList.addAll(newOutgoing);
  }
  if (changed)   updatePeerStats();
}

private void splitPeerList ( ) { List < Peer > newIncoming = new ArrayList < > ( ) ; List < Peer > newOutgoing = new ArrayList < > ( ) ; for ( Peer peer : peerList ) { if ( peer . hasReceivedData ( ) ) { newIncoming . add ( peer ) ; } else { newOutgoing . add ( peer ) ; } } boolean changed = false ; if ( ! newIncoming . equals ( incomingList ) ) { changed = true ; incomingList . clear ( ) ; incomingList . addAll ( newIncoming ) ; } if ( ! newOutgoing . equals ( outgoingList ) ) { changed = true ; outgoingList . clear ( ) ; outgoingList . addAll ( newOutgoing ) ; } if ( changed ) updatePeerStats ( ) ; }
split the peer list between incoming and outgoing peers .
