class ComparatorSelectionSorter<Solution_, T> implements SelectionSorter<Solution_, T> {

    private final Comparator<T> appliedComparator;

    public ComparatorSelectionSorter(Comparator<T> comparator, SelectionSorterOrder selectionSorterOrder) {
        switch (selectionSorterOrder) {
            case ASCENDING:
                this.appliedComparator = comparator;
                break;
            case DESCENDING:
                this.appliedComparator = Collections.reverseOrder(comparator);
                break;
            default:
                throw new IllegalStateException("The selectionSorterOrder (" + selectionSorterOrder
                        + ") is not implemented.");
        }
    }

    @Override
    public void sort(ScoreDirector<Solution_> scoreDirector, List<T> selectionList) {
        selectionList.sort(appliedComparator);
    }

    @Override
    public boolean equals(Object other) {<FILL_FUNCTION_BODY>}

    @Override
    public int hashCode() {
        return Objects.hash(appliedComparator);
    }
}

        if (this == other)
            return true;
        if (other == null || getClass() != other.getClass())
            return false;
        ComparatorSelectionSorter<?, ?> that = (ComparatorSelectionSorter<?, ?>) other;
        return Objects.equals(appliedComparator, that.appliedComparator);
    
<no_super_class>