private <Data> void handleRequest(HttpRequests.Request request, Class<Data> responseDataClass,
                                    ThrowableConsumer<? super Data, ? extends IOException> responseHandler) throws IOException {
    try (InputStream in = request.getInputStream();
         Reader reader = new InputStreamReader(in, StandardCharsets.UTF_8)) {
      Data data = gson.fromJson(reader, responseDataClass);
      responseHandler.consume(data);
    }
    catch (JsonParseException jsonException) {
      throw new IOException("Unexpected response format", jsonException);
    }
  }
private <Data> void handleRequest(HttpRequests.Request request, Class<Data> responseDataClass,
                                    ThrowableConsumer<? super Data, ? extends IOException> responseHandler)