diff --git a/TelegramBots.wiki/FAQ.md b/TelegramBots.wiki/FAQ.md index bacd32d6..928d9536 100644 --- a/TelegramBots.wiki/FAQ.md +++ b/TelegramBots.wiki/FAQ.md @@ -22,9 +22,7 @@ public PhotoSize getPhoto(Update update) { // We fetch the bigger photo return photos.stream() - .sorted(Comparator.comparing(PhotoSize::getFileSize).reversed()) - .findFirst() - .orElse(null); + .max(Comparator.comparing(PhotoSize::getFileSize)).get(); } // Return null if not found