optaplanner-core/src/main/java/org/optaplanner/core/impl/heuristic/selector/move/composite/UnionMoveSelector.java
@Override
    public boolean isNeverEnding() {
        if (randomSelection) {
            for (MoveSelector moveSelector : childMoveSelectorList) {
                if (moveSelector.isNeverEnding()) {
                    return true;
                }
            }
            // The UnionMoveSelector is special: it can be randomSelection true and still neverEnding false
            return false;
        } else {
            // Only the last childMoveSelector can be neverEnding
            if (!childMoveSelectorList.isEmpty()
                    && childMoveSelectorList.get(childMoveSelectorList.size() - 1).isNeverEnding()) {
                return true;
            }
            return false;
        }
    }
@Override
    public boolean isNeverEnding() {
        if (randomSelection) {
            for (MoveSelector moveSelector : childMoveSelectorList) {
                if (moveSelector.isNeverEnding()) {
                    return true;
                }
            }
            // The UnionMoveSelector is special: it can be randomSelection true and still neverEnding false
            return false;
        } else {
            // Only the last childMoveSelector can be neverEnding
            if (!childMoveSelectorList.isEmpty()
                    && childMoveSelectorList.get(childMoveSelectorList.size() - 1).isNeverEnding()) {
                return true;
            }
            return false;
        }
    }
@ Override public boolean isNeverEnding ( ) { if ( randomSelection ) { for ( MoveSelector moveSelector : childMoveSelectorList ) { if ( moveSelector . isNeverEnding ( ) ) { return true ; } } // The UnionMoveSelector is special: it can be randomSelection true and still neverEnding false return false ; } else { // Only the last childMoveSelector can be neverEnding if ( ! childMoveSelectorList . isEmpty ( ) && childMoveSelectorList . get ( childMoveSelectorList . size ( ) - 1 ) . isNeverEnding ( ) ) { return true ; } return false ; } }
************************************************************************
************************************************************************