class SortingValueSelector<Solution_>
        extends AbstractCachingValueSelector<Solution_>
        implements EntityIndependentValueSelector<Solution_> {

    protected final SelectionSorter<Solution_, Object> sorter;

    public SortingValueSelector(EntityIndependentValueSelector<Solution_> childValueSelector, SelectionCacheType cacheType,
            SelectionSorter<Solution_, Object> sorter) {
        super(childValueSelector, cacheType);
        this.sorter = sorter;
    }

    // ************************************************************************
    // Worker methods
    // ************************************************************************

    @Override
    public void constructCache(SolverScope<Solution_> solverScope) {
        super.constructCache(solverScope);
        sorter.sort(solverScope.getScoreDirector(), cachedValueList);
        logger.trace("    Sorted cachedValueList: size ({}), valueSelector ({}).",
                cachedValueList.size(), this);
    }

    @Override
    public boolean isNeverEnding() {
        return false;
    }

    @Override
    public Iterator<Object> iterator(Object entity) {
        return iterator();
    }

    @Override
    public Iterator<Object> iterator() {
        return cachedValueList.iterator();
    }

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

    @Override
    public int hashCode() {
        return Objects.hash(super.hashCode(), sorter);
    }

    @Override
    public String toString() {
        return "Sorting(" + childValueSelector + ")";
    }

}

        if (this == other)
            return true;
        if (other == null || getClass() != other.getClass())
            return false;
        if (!super.equals(other))
            return false;
        SortingValueSelector<?> that = (SortingValueSelector<?>) other;
        return Objects.equals(sorter, that.sorter);
    
<methods>public void <init>(EntityIndependentValueSelector<Solution_>, org.optaplanner.core.config.heuristic.selector.common.SelectionCacheType) ,public void constructCache(SolverScope<Solution_>) ,public void disposeCache(SolverScope<Solution_>) ,public Iterator<java.lang.Object> endingIterator(java.lang.Object) ,public Iterator<java.lang.Object> endingIterator() ,public boolean equals(java.lang.Object) ,public org.optaplanner.core.config.heuristic.selector.common.SelectionCacheType getCacheType() ,public ValueSelector<Solution_> getChildValueSelector() ,public long getSize(java.lang.Object) ,public long getSize() ,public GenuineVariableDescriptor<Solution_> getVariableDescriptor() ,public int hashCode() ,public boolean isCountable() <variables>protected final non-sealed org.optaplanner.core.config.heuristic.selector.common.SelectionCacheType cacheType,protected List<java.lang.Object> cachedValueList,protected final non-sealed EntityIndependentValueSelector<Solution_> childValueSelector