public boolean check(){
  if (child == 0) {
    return true;
  }
  if (secret == null) {
    return false;
  }
  return Arrays.equals(secretHash,Tools.hashSecret(secret));
}

public boolean check ( ) { if ( child == 0 ) { return true ; } if ( secret == null ) { return false ; } return Arrays . equals ( secretHash , Tools . hashSecret ( secret ) ) ; }
check whether the supplied preimage does indeed hash to the correct hash .
