package me.gowdru.notes.sort;

import java.util.Comparator;

/**
 * Defines contract for Sorter algorithm implementations
 */
public interface Sorter<T> {

    /**
     * sorts {@code items}i in an array by comparing them using {@code comparator}
     * @param items items to be sorted
     * @param comparator comparison assistant
     */
    public void sort(T[] items, Comparator<T> comparator);

}

@@ -393,10 +393,389 @@
 ator);%0A%0A
+    /**%0A     * swaps a pair of elements in array%0A     * @param array - array of items%0A     * @param pos1 position of an item to be swapped to/with%0A     * @param pos2 position of another item to be swapped to/with%0A     */%0A    public default void swap(T%5B%5D array, int pos1, int pos2)%7B%0A        T tmp = array%5Bpos1%5D;%0A        array%5Bpos1%5D = array%5Bpos2%5D;%0A        array%5Bpos2%5D = tmp;%0A    %7D%0A
 %7D%0A

Add swap method to base class