JavaRush
AI Academy
new
Promotion
Learning
Courses
Tasks
Quizzes
Games
Help
Schedule of nudges
Internship
Community
Users
Forum
Chat
Articles
Activities
Reviews
Subscriptions
Light theme

Lectures

  • Reviews
  • About us
  • CS50
Start
Start learning
Start learning
  • My progress
  • Courses
  • Quest map
  • Lectures
  • sum, count, average, max, min methods in the Stream API

    JAVA 25 SELF
    31 level,0 lecture
    In this lecture, we cover aggregating operations in the Stream API: how to count with count(), compute sums and averages with primitive streams ( IntStream, LongStream, DoubleStream) and the methods sum(), average(), as well as how to find extrema via min()/ max(). We will also discuss working with the containers Optional, OptionalInt, OptionalLong, OptionalDouble and the right ways to extract values: orElse(...), ifPresent(...), orElseThrow(). You’ll learn to use collectors like Collectors.summingInt, Collectors.averagingInt, Collectors.maxBy/ minBy and combine them with groupingBy. At the end—an overview of common mistakes and nuances.
    Open
  • Reduce and collect methods: data aggregation

    JAVA 25 SELF
    31 level,1 lecture
    We break down terminal stream operations: the universal reduction reduce() and the powerful collector collect(). We’ll understand the signatures with identity, accumulator, and combiner, learn to assemble data using ready-made collectors from Collectors ( toList(), toMap(), joining(), groupingBy()) and see where you should prefer collect() over reduce(). We’ll also discuss working with Optional, handling duplicates in toMap(), and nuances of parallel streams.
    Open
  • Methods groupingBy and partitioningBy (Collectors)

    JAVA 25 SELF
    31 level,2 lecture
    In this lecture, you will learn to group data in streams using the collectors Collectors.groupingBy and Collectors.partitioningBy: simple and nested grouping, splitting by a boolean predicate, choosing between them, processing the result, and tips and tricks. With practical examples using strings, numbers, and objects, you will see how to obtain a Map of the required structure from a stream ( Stream API) and how to work with classifier functions ( Function) and predicates ( Predicate). In the end — a review of common mistakes.
    Open
  • Advanced aggregation: nested groupings

    JAVA 25 SELF
    31 level,3 lecture
    A hands-on dive into nested groupings with Streams and collectors: how to combine Collectors.groupingBy with aggregators ( maxBy, averagingInt, counting), transform data with mapping, split into subsets via partitioningBy, and correctly read nested Map structures. Lots of clear examples, visualization of result structures, and a breakdown of common mistakes.
    Open
  • Advanced collectors

    JAVA 25 SELF
    31 level,4 lecture
    In this lecture, we cover advanced Stream API collector techniques: nested downstream collectors for groupingBy/ partitioningBy, transformations with mapping, filtering with filtering, “flattening” with flatMapping, simultaneous aggregation with teeing (Java 12+), as well as “freezing” collections via toUnmodifiableList/Set/Map and collectingAndThen. We show practical pipelines and common pitfalls.
    Open
Courses
  • Java Course
  • Python Course
  • Development with Claude Code
  • All 16 courses
University
  • Java FullStack
  • Python FullStack
  • AI Native Developer
  • Web FullStack
Community
  • Articles
  • Forum
  • Help with Tasks
Company
  • About us
  • Contacts
  • Reviews
  • Pricing
  • Questions and answers
JavaRush JavaRush: online courses in Java and other programming languages, where you learn by solving tasks. We started in 2012 with a Java course, and today there are 16 courses: Java and Spring, Python, web development, SQL, Go, C#, C++, Kotlin, Swift, Docker and AI development. More than 10,000 tasks with instant checks, and the first level of any course is free. Learn on your own or with a mentor at JavaRush University.
Follow us
Язык интерфейса
Русский
English
Українська
"Programmers are not born" © 2026 JavaRush Terms of Use and Privacy policy
MastercardVisa
"Programmers are not born" © 2026 JavaRush Terms of Use and Privacy policy