In this chapter, we will develop the sorting code and make it more general. We want to sort not only an array of Strings. Essentially, we will write a program that can sort anything that is sortable. That way, we will bring the coding to its full extent toward one of the major strengths of Java: abstraction.
Abstraction, however, does not come without a price tag. When you have a class that sorts strings and you accidentally mix an integer or something else, which is not a string, into the sortable data, then the compiler will complain about it: Java does not allow you to put an int into a String array. When the code is more abstract, such programming errors may slip in. We will look at how to handle such exceptional cases catching and throwing Exceptions.
To identify the bugs, we will use unit testing, applying the industry standard JUnit version 4. As JUnit heavily...