code: public BitSet getAvailablePieces() {
      if (!this.isInitialized()) {
        throw new IllegalStateException("Torrent not yet initialized!");
      }
  
      BitSet availablePieces = new BitSet(this.pieces.length);
  
      synchronized (this.pieces) {
        for (Piece piece : this.pieces) {
          if (piece.available()) {
            availablePieces.set(piece.getIndex());
          }
        }
      }
  
      return availablePieces;
    }
docs: Return a copy of the bit field of available pieces for this torrent.
  <p/>
  <p>
  Available pieces are pieces available in the swarm, and it does not
  include our own pieces.
  </p>