public <T extends BaseRequest<T, R>, R extends BaseResponse> R execute(BaseRequest<T, R> request) {
        return api.send(request);
    }
@Test
    public void setWebhook() throws IOException {
        String url = "https://google.com";
        Integer maxConnections = 100;
        String[] allowedUpdates = {"message", "callback_query"};
        String ipAddress = "1.1.1.1";
        BaseResponse response = bot.execute(new SetWebhook()
                .url(url)
                .certificate(new File(certificateFile))
                .ipAddress(ipAddress)
                .maxConnections(100)
                .allowedUpdates(allowedUpdates)
                .secretToken("secret-token")
                .dropPendingUpdates(true)
        );
        assertTrue(response.isOk());

        WebhookInfo webhookInfo = bot.execute(new GetWebhookInfo()).webhookInfo();
        assertEquals(url, webhookInfo.url());
        assertTrue(webhookInfo.hasCustomCertificate());
        assertEquals(maxConnections, webhookInfo.maxConnections());
        assertArrayEquals(allowedUpdates, webhookInfo.allowedUpdates());
        Integer lastErrorDate = webhookInfo.lastErrorDate();
        if (lastErrorDate != null) {
            assertEquals(System.currentTimeMillis(), lastErrorDate * 1000L, 30_000L);
        }
        String lastErrorMessage = webhookInfo.lastErrorMessage();
        if (lastErrorMessage != null) {
            assertTrue(lastErrorMessage.contains("SSL"));
        }
        assertEquals(ipAddress, webhookInfo.ipAddress());
        assertTrue(webhookInfo.pendingUpdateCount() >= 0);

        response = bot.execute(new SetWebhook().url("https://google.com")
                .certificate(Files.readAllBytes(new File(certificateFile).toPath())).allowedUpdates(""));
        assertTrue(response.isOk());

        response = bot.execute(new SetWebhook());
        assertTrue(response.isOk());
    }