@Override public InstantiatedType apply(Substitution<ReferenceType> substitution){
  List<TypeArgument> argumentList=new ArrayList<>();
  for (  TypeVariable variable : parameters) {
    ReferenceType referenceType=substitution.get(variable);
    if (referenceType == null) {
      referenceType=variable;
    }
    argumentList.add(new ReferenceArgument(referenceType));
  }
  return (InstantiatedType)apply(substitution,new InstantiatedType(new GenericClassType(rawType),argumentList));
}

@ Override public InstantiatedType apply ( Substitution < ReferenceType > substitution ) { List < TypeArgument > argumentList = new ArrayList < > ( ) ; for ( TypeVariable variable : parameters ) { ReferenceType referenceType = substitution . get ( variable ) ; if ( referenceType == null ) { referenceType = variable ; } argumentList . add ( new ReferenceArgument ( referenceType ) ) ; } return ( InstantiatedType ) apply ( substitution , new InstantiatedType ( new GenericClassType ( rawType ) , argumentList ) ) ; }
instantiates this generic class using the substitution to replace the type parameters .
