### Question:
ContentNegociator { public static Expression negociate(VObject inObject, Expression inExpression) { if (ContentNegociator.LOGGER.isDebugEnabled()) { ContentNegociator.LOGGER.debug("Negociating " + inExpression + " for " + inObject.getObject_login()); } final Profile objectProfile = ProfilesManager.getObjectProfile(inObject); final Expression negociated = ContentNegociator.getSupportedExpression(inExpression, objectProfile); if (Expression.MAX_QUALITY.equals(negociated.getQuality())) { if (ContentNegociator.LOGGER.isDebugEnabled()) { ContentNegociator.LOGGER.debug("Object : " + inObject.getObject_login() + " has 100% support for " + negociated); } return negociated; } final SortedSet<Expression> sortedAlternatives = new TreeSet<Expression>(new Comparator<Expression>() { public int compare(Expression o1, Expression o2) { return o1.getQuality().compareTo(o2.getQuality()); } }); sortedAlternatives.add(negociated); for (final Expression expression : inExpression.getAlternatives()) { sortedAlternatives.add(ContentNegociator.getSupportedExpression(expression, objectProfile)); } final Expression theBestOne = ContentNegociator.proposeTTSAlternative(sortedAlternatives.last(), inObject); if (ContentNegociator.LOGGER.isDebugEnabled()) { ContentNegociator.LOGGER.debug("Negociation result : " + theBestOne + " for " + inObject.getObject_login()); } return theBestOne; }  static Expression negociate(VObject inObject, Expression inExpression);  }### Answer:
@Test public void testNegociate() { final Timezone tzParis = Factories.TIMEZONE.findByJavaId("Europe/Paris"); final Lang frLang = getFrLang(); final User theUser = new UserMock(90481, "TestUser", "123", "testuser@violet.invalid", frLang, "France", "Joe", "User", tzParis, Annu.MALE, "75011", "Paris", 0); final VObject theObject = new VObjectMock(42, "123456789012", "jack", theUser, HARDWARE.V2, tzParis, frLang); final Map<String, Object> expression = new HashMap<String, Object>(); expression.put("type", SequencePart.EXPRESSION); expression.put("modality", "net.violet.video"); expression.put("url", "videoUrl"); final List<Object> alts = new ArrayList<Object>(); final Map<String, Object> alt1 = new HashMap<String, Object>(); alt1.put("modality", "net.violet.tts"); alt1.put("text", "Hello Worl"); alts.add(alt1); expression.put("alt", alts); final Expression theExpression = new Expression(expression); final Expression negociatedResult = ContentNegociator.negociate(theObject, theExpression); Assert.assertEquals("net.violet.tts", negociatedResult.getModality()); }