docs: public boolean validate(SharedTorrent torrent, Piece piece) throws IOException {
  
      logger.trace("Validating {}...", this);
  
      // TODO: remove cast to int when large ByteBuffer support is
      // implemented in Java.
      byte[] pieceBytes = data.array();
      final byte[] calculatedHash = TorrentUtils.calculateSha1Hash(pieceBytes);
      this.valid = Arrays.equals(calculatedHash, this.hash);
      logger.trace("validating result of piece {} is {}", this.index, this.valid);
  
      return this.isValid();
    }