code: @Override
    public void handlePieceCompleted(final SharingPeer peer, final Piece piece)
            throws IOException {
      final SharedTorrent torrent = peer.getTorrent();
      final String torrentHash = torrent.getHexInfoHash();
      try {
        final Future<?> validationFuture = myPieceValidatorExecutor.submit(new Runnable() {
          @Override
          public void run() {
            validatePieceAsync(torrent, piece, torrentHash, peer);
          }
        });
        torrent.markCompletedAndAddValidationFuture(piece, validationFuture);
      } catch (RejectedExecutionException e) {
        torrent.markUncompleted(piece);
        LoggerUtils.warnWithMessageAndDebugDetails(logger, "Unable to submit validation task for torrent {}", torrentHash, e);
      }
    }
docs: Piece download completion handler.
  <p/>
  <p>
  When a piece is completed, and valid, we announce to all connected peers
  that we now have this piece.
  </p>
  <p/>
  <p>
  We use this handler to identify when all of the pieces have been
  downloaded. When that's the case, we can start the seeding period, if
  any.
  </p>
  
  @param peer  The peer we got the piece from.
  @param piece The piece in question.