code: public static Event constructEvent(String payload, String sigHeader, String secret,
        long tolerance) throws SignatureVerificationException {
      Event event = ApiResource.GSON.fromJson(payload, Event.class);
      Signature.verifyHeader(payload, sigHeader, secret, tolerance);
      return event;
    }
docs: Returns an Event instance using the provided JSON payload. Throws a
  JsonSyntaxException if the payload is not valid JSON, and a
  SignatureVerificationException if the signature verification fails for
  any reason.
  
  @param payload   the payload sent by Stripe.
  @param sigHeader the contents of the signature header sent by Stripe.
  @param secret    secret used to generate the signature.
  @param tolerance maximum difference in seconds allowed between the header's
  timestamp and the current time
  @return the Event instance
  @throws SignatureVerificationException if the verification fails.