private Substitution<ReferenceType> selectAndExtend(List<TypeVariable> parameters,Substitution<ReferenceType> substitution){
  List<ReferenceType> selectedTypes=new ArrayList<>();
  for (  TypeVariable typeArgument : parameters) {
    List<ReferenceType> candidates=selectCandidates(typeArgument);
    if (candidates.isEmpty()) {
      if (Log.isLoggingOn()) {
        Log.logLine("No candidate types for " + typeArgument);
      }
      return null;
    }
    selectedTypes.add(Randomness.randomMember(candidates));
  }
  return substitution.extend(Substitution.forArgs(parameters,selectedTypes));
}

private Substitution < ReferenceType > selectAndExtend ( List < TypeVariable > parameters , Substitution < ReferenceType > substitution ) { List < ReferenceType > selectedTypes = new ArrayList < > ( ) ; for ( TypeVariable typeArgument : parameters ) { List < ReferenceType > candidates = selectCandidates ( typeArgument ) ; if ( candidates . isEmpty ( ) ) { if ( Log . isLoggingOn ( ) ) { Log . logLine ( "No candidate types for " + typeArgument ) ; } return null ; } selectedTypes . add ( Randomness . randomMember ( candidates ) ) ; } return substitution . extend ( Substitution . forArgs ( parameters , selectedTypes ) ) ; }
selects types independently for a list of type parameters , and extends the given substitution by the substitution of the selected types for the parameters . important : should only be used for parameters that have non - generic bounds .
