To implement the sorting, first, we will define the interfaces that the library should implement. Defining the interface before actually coding is a good practice. When there are many implementations, it is sometimes recommended to first create a simple one and start using it so that the interface may evolve during this development phase, and when the more complex implementations are due, then the interface is already fixed. In reality, nothing is fixed ever because there is no Archimedean point in programming.
Coding the sort
Creating the interfaces
The interface in our case is very simple:
public interface Sort { void sort(Sortable collection); }
The interface should do only one thing, sort something that is sortable...