public ConstraintMap createAssignmentConstraints(final AnnotatedTypeMirror assignedTo,final AnnotatedTypeMirror boxedReturnType,final AnnotatedExecutableType methodType,final Set<AFConstraint> afArgumentConstraints,final Map<TypeVariable,AnnotatedTypeMirror> inferredArgs,final Set<TypeVariable> targets,final AnnotatedTypeFactory typeFactory){
  final LinkedList<AFConstraint> assignmentAfs=new LinkedList<>();
  for (  AnnotatedTypeVariable typeParam : methodType.getTypeVariables()) {
    final TypeVariable target=typeParam.getUnderlyingType();
    final AnnotatedTypeMirror inferredType=inferredArgs.get(target);
    if (inferredType != null) {
      assignmentAfs.add(new A2F(inferredType,typeParam.getUpperBound()));
      assignmentAfs.add(new F2A(typeParam.getLowerBound(),inferredType));
    }
 else {
      assignmentAfs.add(new F2A(typeParam,typeParam.getUpperBound()));
      assignmentAfs.add(new A2F(typeParam.getLowerBound(),typeParam));
    }
  }
  for (  AFConstraint argConstraint : afArgumentConstraints) {
    if (argConstraint instanceof F2A) {
      assignmentAfs.add(argConstraint);
    }
  }
  LinkedList<AFConstraint> substitutedAssignmentConstraints=new LinkedList<>();
  for (  AFConstraint afConstraint : assignmentAfs) {
    substitutedAssignmentConstraints.add(afConstraint.substitute(inferredArgs));
  }
  final AnnotatedTypeMirror substitutedReturnType=TypeArgInferenceUtil.substitute(inferredArgs,boxedReturnType);
  substitutedAssignmentConstraints.add(new F2A(substitutedReturnType,assignedTo));
  final Set<AFConstraint> reducedConstraints=new LinkedHashSet<>();
  reduceAfConstraints(typeFactory,reducedConstraints,substitutedAssignmentConstraints,targets);
  final Set<TUConstraint> tuAssignmentConstraints=afToTuConstraints(reducedConstraints,targets);
  addConstraintsBetweenTargets(tuAssignmentConstraints,targets,true,typeFactory);
  return constraintMapBuilder.build(targets,tuAssignmentConstraints,typeFactory);
}

public ConstraintMap createAssignmentConstraints ( final AnnotatedTypeMirror assignedTo , final AnnotatedTypeMirror boxedReturnType , final AnnotatedExecutableType methodType , final Set < AFConstraint > afArgumentConstraints , final Map < TypeVariable , AnnotatedTypeMirror > inferredArgs , final Set < TypeVariable > targets , final AnnotatedTypeFactory typeFactory ) { final LinkedList < AFConstraint > assignmentAfs = new LinkedList < > ( ) ; for ( AnnotatedTypeVariable typeParam : methodType . getTypeVariables ( ) ) { final TypeVariable target = typeParam . getUnderlyingType ( ) ; final AnnotatedTypeMirror inferredType = inferredArgs . get ( target ) ; if ( inferredType != null ) { assignmentAfs . add ( new A2F ( inferredType , typeParam . getUpperBound ( ) ) ) ; assignmentAfs . add ( new F2A ( typeParam . getLowerBound ( ) , inferredType ) ) ; } else { assignmentAfs . add ( new F2A ( typeParam , typeParam . getUpperBound ( ) ) ) ; assignmentAfs . add ( new A2F ( typeParam . getLowerBound ( ) , typeParam ) ) ; } } for ( AFConstraint argConstraint : afArgumentConstraints ) { if ( argConstraint instanceof F2A ) { assignmentAfs . add ( argConstraint ) ; } } LinkedList < AFConstraint > substitutedAssignmentConstraints = new LinkedList < > ( ) ; for ( AFConstraint afConstraint : assignmentAfs ) { substitutedAssignmentConstraints . add ( afConstraint . substitute ( inferredArgs ) ) ; } final AnnotatedTypeMirror substitutedReturnType = TypeArgInferenceUtil . substitute ( inferredArgs , boxedReturnType ) ; substitutedAssignmentConstraints . add ( new F2A ( substitutedReturnType , assignedTo ) ) ; final Set < AFConstraint > reducedConstraints = new LinkedHashSet < > ( ) ; reduceAfConstraints ( typeFactory , reducedConstraints , substitutedAssignmentConstraints , targets ) ; final Set < TUConstraint > tuAssignmentConstraints = afToTuConstraints ( reducedConstraints , targets ) ; addConstraintsBetweenTargets ( tuAssignmentConstraints , targets , true , typeFactory ) ; return constraintMapBuilder . build ( targets , tuAssignmentConstraints , typeFactory ) ; }
the first half of step 6 . this method creates constraints : a ) between the bounds of types that are already inferred and their inferred arguments b ) between the assignment context and the return type of the method ( with the previously inferred arguments substituted into these constraints )
