diff --git a/extractor/src/test/java/org/schabi/newpipe/extractor/services/youtube/search/YoutubeSearchExtractorTest.java b/extractor/src/test/java/org/schabi/newpipe/extractor/services/youtube/search/YoutubeSearchExtractorTest.java index 6e5485e2a..982e2c0d4 100644 --- a/extractor/src/test/java/org/schabi/newpipe/extractor/services/youtube/search/YoutubeSearchExtractorTest.java +++ b/extractor/src/test/java/org/schabi/newpipe/extractor/services/youtube/search/YoutubeSearchExtractorTest.java @@ -412,17 +412,13 @@ public class YoutubeSearchExtractorTest { @Override public InfoItem.InfoType expectedInfoItemType() { return InfoItem.InfoType.STREAM; } @Test - public void testShortFormContent() throws IOException, ExtractionException { - final List items = extractor.getInitialPage().getItems(); - boolean hasShortFormContent = false; - for (InfoItem item : items) { - if (((StreamInfoItem) item).isShortFormContent()) { - hasShortFormContent = true; - break; - } - } - - assertTrue(hasShortFormContent); + void testShortFormContent() throws IOException, ExtractionException { + assertTrue(extractor.getInitialPage() + .getItems() + .stream() + .filter(StreamInfoItem.class::isInstance) + .map(StreamInfoItem.class::cast) + .anyMatch(StreamInfoItem::isShortFormContent)); } } }