@SafeVarargs public static <T>Substitution<T> forArgs(List<TypeVariable> parameters,T... arguments){
  if (parameters.size() != arguments.length) {
    throw new IllegalArgumentException("number of parameters and arguments must agree, have: " + parameters.size() + ", "+ arguments.length);
  }
  Substitution<T> s=new Substitution<>();
  for (int i=0; i < parameters.size(); i++) {
    s.put(parameters.get(i),arguments[i]);
  }
  return s;
}

@ SafeVarargs public static < T > Substitution < T > forArgs ( List < TypeVariable > parameters , T ... arguments ) { if ( parameters . size ( ) != arguments . length ) { throw new IllegalArgumentException ( "number of parameters and arguments must agree, have: " + parameters . size ( ) + ", " + arguments . length ) ; } Substitution < T > s = new Substitution < > ( ) ; for ( int i = 0 ; i < parameters . size ( ) ; i ++ ) { s . put ( parameters . get ( i ) , arguments [ i ] ) ; } return s ; }
create a substitution from the type parameters to the corresponding type arguments . requires that the number of parameters and arguments agree .
