5
Generics, Collections,
and Testing
Objectives
An introduction to the use of the Java generic construct
An introduction to the Java Collections Framework, including the Java
LinkedList data structure
An introduction to the use of the Java iterator construct
Implementation of a user-constructed Collection class
Testing using JUnit
Key Terms
collection
elements
foreach
generics
iterator
JCF
Introduction
We claimed at the outset that this was a text on computing using Java as the
vehicle, not a text on programming in Java. This chapter will come closest to
violating that principle because we will cover three specifics of Java that aid in the
writing of
Get Data Structures Using Java now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.