Java Generics & Test First Development

After reading this chapter and engaging in the embedded activities and reflections, you should be able to:

  • Implement the IndexedList ADT using Java's built-in array.
  • Explain why we use generics in ADT declarations.
  • Identify the syntax of Java Generics.
  • Translate the IndexedList ADT into a generic interface.
  • Implement the generic IndexedList ADT with a concrete Java class.
  • Create an array of generic types in Java with a fixed size.
  • Explain the need for testing the implementations of an ADT.
  • Define what a unit test is.
  • Apply the JUnit framework to unit testing Java code.
  • Express best practices of unit testing.
  • Write simple unit tests using the JUnit framework.
  • Use JUnit's @BeforeEach annotation to create setup methods.
  • Appreciate the value of Unit Testing & Test-First Development in software construction.

Starter code for this chapter

Solution code

Solution code for this chapter.