public TypeTuple apply(Substitution<ReferenceType> substitution){
  List<Type> typeList=new ArrayList<>();
  for (  Type type : this.list) {
    Type newType=type.apply(substitution);
    if (newType != null) {
      typeList.add(newType);
    }
 else {
      typeList.add(type);
    }
  }
  return new TypeTuple(typeList);
}

public TypeTuple apply ( Substitution < ReferenceType > substitution ) { List < Type > typeList = new ArrayList < > ( ) ; for ( Type type : this . list ) { Type newType = type . apply ( substitution ) ; if ( newType != null ) { typeList . add ( newType ) ; } else { typeList . add ( type ) ; } } return new TypeTuple ( typeList ) ; }
applies a substitution to a type tuple , replacing any occurrences of type variables . resulting tuple may only be partially instantiated .
