private static void checkValidHash(byte[] hash) {
    if (hash != null) {
      if (hash.length != SIGNATURE_LENGTH) {
        throw new IllegalArgumentException("hash.length(=" + hash.length + ") must be " + SIGNATURE_LENGTH);
      }
    }
  }
private static void checkValidHash(byte[] hash)