abstract class Sorter<T extends Comparable<T>> implements ISort<T> { private SeqValidator<T> validator = new SeqValidator<T>(); // ISort methods public T[] sort(T[] seq) throws IllegalArgumentException { validator.assertSeqNotEmpty(seq); maneuver(seq, 0, seq.length - 1); return seq; } public T[] sort(T[] seq, int from, int to) throws IndexOutOfBoundsException, IllegalArgumentException { validator.assertValidRange(seq, from, to); maneuver(seq, from, to); return seq; } // Abstract methods public abstract void maneuver(T[] seq, int from, int to); }