April 2017
Beginner
504 pages
14h 11m
English
Now that we have discussed what a good unit test is, let's improve our test. The first thing is to move the supporting classes to separate files. We will create ArrayListSortableCollection:
package packt.java9.by.example.ch03.bubble; import packt.java9.by.example.ch03.SortableCollection; import java.util.ArrayList; public class ArrayListSortableCollection implements SortableCollection { final private ArrayList actualNames; ArrayListSortableCollection(ArrayList actualNames) { this.actualNames = actualNames; } @Override public Object get(int i) { return actualNames.get(i); } @Override public int size() { return actualNames.size(); } }
This class encapsulates ArrayList and then implements the get and size methods ...
Read now
Unlock full access