O'Reilly logo
live online training icon Live Online training

Java Next Steps: Collections, Generics, and Streams

Topic: Software Development
Ben Evans

Understanding Java’s Collections—the language’s core implementation of fundamental data structures and algorithms—is essential for every professional Java programmer. But to use the Collections effectively, developers also need to understand Java’s generics, which are an important part of the type system, as well as Java 8’s Streams API, which brings a taste of functional programming to modern Java applications.

Join expert Ben Evans for an introduction to Java’s Collections. Whether you’re new to the language and ecosystem or are looking to refresh your skills, you’ll learn the fundamentals, the strengths (and limitations) of the Collections, and how to put them to work in your projects immediately.

What you'll learn-and how you can apply it

By the end of this live online course, you’ll understand:

  • The fundamentals of Java’s type system
  • Basic data structures as implemented in the Collections
  • The strengths (and limitations) of the Collections

And you’ll be able to:

  • Work with some of the core classes of the Java Development Kit (JDK)
  • Use the Collections to represent and manipulate data
  • Navigate the large number of useful helper methods the Collections provide

This training course is for you because...

  • You’re a developer at an early stage of your career.
  • You learned Java a while back and need to refresh your core Java skills.
  • You want to become a professional backend or full stack developer.


  • A computer with Java 11, OpenJDK 11, and JetBrains IntelliJ IDEA (Community Edition) installed (The course will use the JShell tool, which isn’t included in Java 8. If you only have Java 8 installed, it will be harder for you to code along with the course examples.)
  • A working knowledge of Java
  • Experience with another language, such as JavaScript or Python (useful but not required)

Recommended follow-up:

About your instructor

  • Ben Evans is principal engineer and architect for JVM technologies at New Relic. Previously, Ben was a cofounder of the Java performance startup jClarity (acquired by Microsoft), chief architect for listed derivatives at Deutsche Bank, and senior developer at Morgan Stanley, where he was responsible for performance testing the systems used for Google’s IPO. He’s the author of Optimizing Java, the recently updated Java in a Nutshell, seventh edition, The Well-Grounded Java Developer, and Java: The Legend. He’s the Java and JVM track lead at InfoQ, a frequent contributor to Oracle's Java Magazine, and a regular speaker at conferences worldwide. Ben has been contributing to open source software for over 20 years. He was a cofounder of the Adopt-a-JSR and AdoptOpenJDK initiatives and served on the Java Community Process Executive Committee for six years.


The timeframes are only estimates and may vary according to how the class is progressing

Java’s type system (55 minutes)

  • Demo: Inheritance and access control; interfaces
  • Presentation: Lambda expressions
  • Hands-on exercises: Work with interfaces; work with lambdas
  • Q&A

Break (5 minutes)

Java generics I (30 minutes)

  • Demo: Array covariance; intro to generics
  • Hands-on exercise: Write a simple generic type
  • Q&A

Introduction to Java Collections (55 minutes)

  • Demo: Intro to Java’s List, Map, and Set; Java Collections helper methods
  • Hands-on exercise: Work with lists

Break (5 minutes)

Java generics II (25 minutes)

  • Demo: Generic methods; covariance and contravariance
  • Hands-on exercise: Write a simple generic method
  • Q&A

Break (5 minutes)

Java streams (50 minutes)

  • Presentation: External and internal iteration
  • Demo: Default methods; intro to Java streams; advanced streams (e.g., laziness, primitive streams)
  • Hands-on exercises: Write an interface with a default method; work with streams

Wrap-up and Q&A (10 minutes)