code: public static boolean isGroupUpdate(Update update) {
      if (MESSAGE.test(update)) {
        return update.getMessage().isGroupMessage();
      } else if (CALLBACK_QUERY.test(update)) {
        return update.getCallbackQuery().getMessage().isGroupMessage();
      } else if (CHANNEL_POST.test(update)) {
        return update.getChannelPost().isGroupMessage();
      } else if (EDITED_CHANNEL_POST.test(update)) {
        return update.getEditedChannelPost().isGroupMessage();
      } else if (EDITED_MESSAGE.test(update)) {
        return update.getEditedMessage().isGroupMessage();
      } else {
        return false;
      }
    }
docs: A "best-effort" boolean stating whether the update is a group message or not.
  
  @param update a Telegram {@link Update}
  @return whether the update is linked to a group