optaplanner-core/src/main/java/org/optaplanner/core/impl/heuristic/selector/entity/pillar/DefaultPillarSelector.java
@Override
    public void constructCache(DefaultSolverScope solverScope) {
        long entitySize = entitySelector.getSize();
        if (entitySize > (long) Integer.MAX_VALUE) {
            throw new IllegalStateException("The selector (" + this + ") has an entitySelector ("
                    + entitySelector + ") with entitySize (" + entitySize
                    + ") which is higher than Integer.MAX_VALUE.");
        }
        Map<List<Object>, List<Object>> valueStateToPillarMap = new LinkedHashMap<>((int) entitySize);
        for (Object entity : entitySelector) {
            List<Object> valueState = new ArrayList<>(variableDescriptors.size());
            for (GenuineVariableDescriptor variableDescriptor : variableDescriptors) {
                Object value = variableDescriptor.getValue(entity);
                valueState.add(value);
            }
            List<Object> pillar = valueStateToPillarMap.computeIfAbsent(valueState, key -> new ArrayList<>());
            pillar.add(entity);
        }
        cachedBasePillarList = new ArrayList<>(valueStateToPillarMap.values());
    }
@Override
    public void constructCache(DefaultSolverScope solverScope) {
        long entitySize = entitySelector.getSize();
        if (entitySize > (long) Integer.MAX_VALUE) {
            throw new IllegalStateException("The selector (" + this + ") has an entitySelector ("
                    + entitySelector + ") with entitySize (" + entitySize
                    + ") which is higher than Integer.MAX_VALUE.");
        }
        Map<List<Object>, List<Object>> valueStateToPillarMap = new LinkedHashMap<>((int) entitySize);
        for (Object entity : entitySelector) {
            List<Object> valueState = new ArrayList<>(variableDescriptors.size());
            for (GenuineVariableDescriptor variableDescriptor : variableDescriptors) {
                Object value = variableDescriptor.getValue(entity);
                valueState.add(value);
            }
            List<Object> pillar = valueStateToPillarMap.computeIfAbsent(valueState, key -> new ArrayList<>());
            pillar.add(entity);
        }
        cachedBasePillarList = new ArrayList<>(valueStateToPillarMap.values());
    }
@ Override public void constructCache ( DefaultSolverScope solverScope ) { long entitySize = entitySelector . getSize ( ) ; if ( entitySize > ( long ) Integer . MAX_VALUE ) { throw new IllegalStateException ( "The selector (" + this + ") has an entitySelector (" + entitySelector + ") with entitySize (" + entitySize + ") which is higher than Integer.MAX_VALUE." ) ; } Map < List < Object > , List < Object > > valueStateToPillarMap = new LinkedHashMap <> ( ( int ) entitySize ) ; for ( Object entity : entitySelector ) { List < Object > valueState = new ArrayList <> ( variableDescriptors . size ( ) ) ; for ( GenuineVariableDescriptor variableDescriptor : variableDescriptors ) { Object value = variableDescriptor . getValue ( entity ) ; valueState . add ( value ) ; } List < Object > pillar = valueStateToPillarMap . computeIfAbsent ( valueState , key -> new ArrayList <> ( ) ) ; pillar . add ( entity ) ; } cachedBasePillarList = new ArrayList <> ( valueStateToPillarMap . values ( ) ) ; }
************************************************************************
************************************************************************