@Override
	public synchronized void handlePeerDisconnected(SharingPeer peer) {
		BitSet availablePieces = peer.getAvailablePieces();

		for (int i = availablePieces.nextSetBit(0); i >= 0;
				i = availablePieces.nextSetBit(i+1)) {
			this.pieces[i].noLongerAt(peer);
			this.rarest.remove(this.pieces[i]);
			this.rarest.add(this.pieces[i]);
		}

		Piece requested = peer.getRequestedPiece();
		if (requested != null) {
			this.requestedPieces.set(requested.getIndex(), false);
		}

		logger.debug("Peer " + peer + " went away with " +
				availablePieces.cardinality() + " piece(s) [" +
				this.completedPieces.cardinality() + "/" +
				this.getAvailablePieces().cardinality() + "/" +
				this.pieces.length + "].");
		logger.trace("We now have " + this.completedPieces.cardinality() +
				" piece(s) and " + this.requestedPieces.cardinality() +
				" outstanding request(s): " + this.requestedPieces + ".");
	}