public <T extends BaseRequest<T, R>, R extends BaseResponse> R execute(BaseRequest<T, R> request) {
        return api.send(request);
    }
@Test
    public void sendDocument() {
        Message message = bot.execute(new SendDocument(chatId, docFileId)).message();
        MessageTest.checkMessage(message);
        DocumentTest.check(message.document());

        message = bot.execute(
                        new SendDocument(chatId, docBytes).thumb(thumbBytes).contentType("application/pdf")
                                .caption("caption").captionEntities(new MessageEntity(MessageEntity.Type.italic, 0, 7)))
                .message();
        MessageTest.checkMessage(message);
        DocumentTest.check(message.document());
        assertEquals(thumbSize, message.document().thumb().fileSize());
        MessageEntity captionEntity = message.captionEntities()[0];
        assertEquals(MessageEntity.Type.italic, captionEntity.type());
        assertEquals((Integer) 0, captionEntity.offset());
        assertEquals((Integer) 7, captionEntity.length());

        String caption = "caption <b>bold</b>", fileName = "my doc.pdf";
        ParseMode parseMode = ParseMode.HTML;
        message = bot.execute(
                        new SendDocument(chatId, docFile).fileName(fileName).thumb(thumbFile).caption(caption).parseMode(parseMode)
                                .disableContentTypeDetection(true))
                .message();
        MessageTest.checkMessage(message);
        DocumentTest.check(message.document());
        assertEquals(caption.replace("<b>", "").replace("</b>", ""), message.caption());
        assertEquals(fileName, message.document().fileName());
        assertEquals(thumbSize, message.document().thumb().fileSize());

        captionEntity = message.captionEntities()[0];
        assertEquals(MessageEntity.Type.bold, captionEntity.type());
        assertEquals((Integer) 8, captionEntity.offset());
        assertEquals((Integer) 4, captionEntity.length());
    }