public <T extends BaseRequest<T, R>, R extends BaseResponse> R execute(BaseRequest<T, R> request) {
        return api.send(request);
    }
@Test
    public void sendAnimation() {
        int expectedSize = 160; // idk why?
        int width = 340, height = 240;
        String caption = "gif *file*", captionCheck = "gif file";
        SendResponse response = bot.execute(new SendAnimation(chatId, gifFile)
                .duration(222).width(width).height(height).thumb(thumbFile)
                .caption(caption).parseMode(ParseMode.Markdown).hasSpoiler(true));
        assertTrue(response.isOk());
        Animation animation = response.message().animation();
        assertEquals((Integer) 1, animation.duration());
        assertEquals(expectedSize, animation.width().intValue());
        assertEquals(expectedSize, animation.height().intValue());
        assertNotEquals("telegram should generate thumb", thumbSize, animation.thumb().fileSize());
        assertEquals(captionCheck, response.message().caption());
        assertEquals(MessageEntity.Type.bold, response.message().captionEntities()[0].type());

        response = bot.execute(new SendAnimation(chatId, gifBytes).thumb(thumbBytes)
                .caption("caption").captionEntities(new MessageEntity(MessageEntity.Type.italic, 0, 7)));
        animation = response.message().animation();
        assertEquals((Integer) 1, animation.duration());
        assertEquals(expectedSize, animation.width().intValue());
        assertEquals(expectedSize, animation.height().intValue());
        assertNotEquals("telegram should generate thumb", thumbSize, animation.thumb().fileSize());
        MessageEntity captionEntity = response.message().captionEntities()[0];
        assertEquals(MessageEntity.Type.italic, captionEntity.type());
        assertEquals((Integer) 0, captionEntity.offset());
        assertEquals((Integer) 7, captionEntity.length());

        response = bot.execute(new SendAnimation(chatId, gifFileId));
        animation = response.message().animation();
        assertEquals((Integer) 3, animation.duration());
        assertEquals((Integer) 128, animation.width());
        assertEquals((Integer) 128, animation.height());
    }