code: public synchronized Sha256Hash hashForWitnessSignature(
              int inputIndex,
              Script scriptCode,
              Coin prevValue,
              SigHash type,
              boolean anyoneCanPay) {
          return hashForWitnessSignature(inputIndex, scriptCode.getProgram(), prevValue, type, anyoneCanPay);
      }
docs: <p>Calculates a signature hash, that is, a hash of a simplified form of the transaction. How exactly the transaction
  is simplified is specified by the type and anyoneCanPay parameters.</p>
  
  <p>This is a low level API and when using the regular {@link Wallet} class you don't have to call this yourself.
  When working with more complex transaction types and contracts, it can be necessary. When signing a Witness output
  the scriptCode should be the script encoded into the scriptSig field, for normal transactions, it's the
  scriptPubKey of the output you're signing for. (See BIP143: https://github.com/bitcoin/bips/blob/master/bip-0143.mediawiki)</p>
  
  @param inputIndex   input the signature is being calculated for. Tx signatures are always relative to an input.
  @param scriptCode   the script that should be in the given input during signing.
  @param prevValue    the value of the coin being spent
  @param type         Should be SigHash.ALL
  @param anyoneCanPay should be false.