### Question:
MdcAdvisor extends AbstractAdvisor<MethodMdc> { void processMethodDefinitions(MethodInvocation invocation, MethodMdc methodMdc, Set<String> localKeys) { for (ParameterMdc definition : methodMdc.getMethodDefinitions()) { String key = definition.getKey(); if (key.isEmpty()) { key = invocation.getMethod().getName(); } String expressionString = definition.getExpressionString(); if (expressionString.isEmpty()) { Object[] arguments = invocation.getArguments(); List<String> parameterNames = methodMdc.getParameterNames(); for (int a = 0; a < arguments.length; a++) { String parameterName = parameterNames.get(a); if (isNull(parameterName)) { putMdc(synthesizeKey(key, a), arguments[a], definition, localKeys); } else if (definition.getKey().isEmpty()) { putMdc(parameterName, arguments[a], definition, localKeys); } else { putMdc(synthesizeKey(key, parameterName), arguments[a], definition, localKeys); } } } else { Object value = expressionEvaluator.evaluate(expressionString); putMdc(key, value, definition, localKeys); } } } private  MdcAdvisor(List<MethodMdc> methodMdcs,
                       ExpressionEvaluator expressionEvaluator); @Override Object invoke(MethodInvocation invocation);  }### Answer:
@Test public void processMethodDefinitions() { MethodMdc methodMdc = mock(MethodMdc.class); ParameterMdc parameterMdc = givenParameterMdc("key", "value"); ParameterMdc parameterMdc1 = givenParameterMdc("key1", "value1"); when(methodMdc.getMethodDefinitions()).thenReturn(new LinkedHashSet<>(asList(parameterMdc, parameterMdc1))); MdcAdvisor mdcAdvisor = MdcAdvisor.newInstance(singletonList(methodMdc), givenExpressionEvaluator("value", "value1")); assertNotNull(mdcAdvisor); MdcAdvisor mdcAdvisorStub = spy(mdcAdvisor); doNothing().when(mdcAdvisorStub).putMdc(any(), any(), any(), any()); mdcAdvisorStub.processMethodDefinitions(givenMethodInvocation("0", "1", "2"), methodMdc, localKeys); verify(mdcAdvisorStub).putMdc("key", "value", parameterMdc, localKeys); verify(mdcAdvisorStub).putMdc("key1", "value1", parameterMdc1, localKeys); }