From 935b75d68593e97e9031d6f6e4d8dc880a497195 Mon Sep 17 00:00:00 2001 From: taksoidet <37811810+taksoidet@users.noreply.github.com> Date: Thu, 31 Jan 2019 02:33:30 +0300 Subject: [PATCH] Change stream --- TelegramBots.wiki/FAQ.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) 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