public <T extends Serializable, Method extends BotApiMethod<T>> Optional<T> execute(Method method) {
    try {
      return Optional.ofNullable(telegramClient.execute(method));
    } catch (TelegramApiException e) {
      log.error("Could not execute bot API method", e);
      return Optional.empty();
    }
  }
@Test
  void returnOptionalOnSuccess() throws TelegramApiException {
    String data = "data";
    when(telegramClient.execute(isNull(BotApiMethod.class))).thenReturn(data);

    Optional<Serializable> execute = silent.execute(null);

    assertEquals(data, execute.get(), "Silent execution resulted in a different object");
  }