docs: public synchronized FilteredBlock applyAndUpdate(Block block) {
          List<Transaction> txns = block.getTransactions();
          List<Sha256Hash> txHashes = new ArrayList<>(txns.size());
          List<Transaction> matched = Lists.newArrayList();
          byte[] bits = new byte[(int) Math.ceil(txns.size() / 8.0)];
          for (int i = 0; i < txns.size(); i++) {
              Transaction tx = txns.get(i);
              txHashes.add(tx.getTxId());
              if (applyAndUpdate(tx)) {
                  Utils.setBitLE(bits, i);
                  matched.add(tx);
              }
          }
          PartialMerkleTree pmt = PartialMerkleTree.buildFromLeaves(block.getParams(), bits, txHashes);
          FilteredBlock filteredBlock = new FilteredBlock(block.getParams(), block.cloneAsHeader(), pmt);
          for (Transaction transaction : matched)
              filteredBlock.provideTransaction(transaction);
          return filteredBlock;
      }