### Question:
SessionAttributesMapArgumentResolver implements ArgumentResolver { @Override public Optional<Object> resolve(ArgumentResolverContext input) { if (input.parameterTypeEquals(Map.class) && input.getMethodParameter().findAnnotation(SessionAttributes.class).isPresent()) { return Optional.of(input.getHandlerInput().getAttributesManager().getSessionAttributes()); } return Optional.empty(); }  @Override Optional<Object> resolve(ArgumentResolverContext input);  }### Answer:
@Test public void testSupportAndResolve() throws NoSuchMethodException { Method method = MappingsController.class.getMethod("handleSession", Map.class); MethodParameter methodParameter = new MethodParameter( method, 0, Map.class, method.getParameterAnnotations()[0] ); RequestEnvelope envelope = Utils.buildSimpleEnvelope("intent"); ArgumentResolverContext input = new ArgumentResolverContext(mockSkillContext, methodParameter, HandlerInput.builder().withRequestEnvelope(envelope).build()); assertSame(envelope.getSession().getAttributes(), resolver.resolve(input).get()); }
@Test public void testDoesntSupport() throws NoSuchMethodException { MethodParameter methodParameter = new MethodParameter( this.getClass().getMethod("testSupportAndResolve"), 0, Object.class, MethodParameter.EMPTY_ANNOTATIONS ); RequestEnvelope envelope = Utils.buildSimpleEnvelope("intent"); ArgumentResolverContext input = new ArgumentResolverContext(mockSkillContext, methodParameter, HandlerInput.builder().withRequestEnvelope(envelope).build()); assertFalse(resolver.resolve(input).isPresent()); }