code: protected LightweightTypeReference createMapTypeReference(JvmGenericType mapType, LightweightTypeReference pairType, LightweightTypeReference expectation, ITypeReferenceOwner owner) {
  		List<LightweightTypeReference> leftAndRight = pairType.getTypeArguments();
  		
  		LightweightTypeReference left = leftAndRight.get(0).getInvariantBoundSubstitute();
  		LightweightTypeReference right = leftAndRight.get(1).getInvariantBoundSubstitute();
  		
  		LightweightTypeReference mapExpectation = getMapExpectation(expectation);
  		if (mapExpectation != null) {
  			List<LightweightTypeReference> typeArguments = expectation.getTypeArguments();
  			left = doNormalizeElementType(left, typeArguments.get(0));
  			right = doNormalizeElementType(right, typeArguments.get(1));
  		}
  		ParameterizedTypeReference result = owner.newParameterizedTypeReference(mapType);
  		result.addTypeArgument(left.copyInto(owner));
  		result.addTypeArgument(right.copyInto(owner));
  		if (mapExpectation != null && !expectation.isAssignableFrom(result)) {
  			// expectation does not match the computed type, but looks good according to the element types:
  			// use expected type
  			if (matchesExpectation(left, mapExpectation.getTypeArguments().get(0)) && matchesExpectation(right, mapExpectation.getTypeArguments().get(1))) {
  				return expectation;
  			}
  		}
  		return result;
  	}
docs: Creates a map type reference that comes as close as possible / necessary to its expected type.