public static < T extends Sorter > T createSorterElseDefault ( final SortType type , final T defaultSorter ) { try { return createSorter ( type ) ; } catch ( IllegalArgumentException ignore ) { return defaultSorter ; } }
Creates an instance of the Sorter interface implementing the sorting algorithm based on the SortType otherwise returns the provided default Sorter implementation if a Sorter based on the specified SortType is not available .