### Question:
EchoMacro extends AbstractMacro { public void execute( Sink sink, MacroRequest request ) { sink.verbatim( SinkEventAttributeSet.BOXED ); sink.text( "echo" + EOL ); for ( String key : request.getParameters().keySet() ) { if ( "parser".equals( key ) || "sourceContent".equals( key ) ) { continue; } sink.text( key + " ---> " + request.getParameter( key ) + EOL ); } sink.verbatim_(); }  void execute( Sink sink, MacroRequest request );  }### Answer:
@Test public void testExecute() { final Map<String,Object> macroParameters = new HashMap<>(); macroParameters.put( "paramName", "paramValue" ); macroParameters.put( "parser", "parserValue" ); macroParameters.put( "sourceContent", "sourceContentValue" ); SinkEventTestingSink sink = new SinkEventTestingSink(); MacroRequest request = new MacroRequest( macroParameters, new File( "." ) ); new EchoMacro().execute( sink, request ); Iterator<SinkEventElement> it = sink.getEventList().iterator(); SinkEventElement event = it.next(); assertEquals( "verbatim", event.getName() ); event = it.next(); assertEquals( "text", event.getName() ); assertEquals( "echo" + Macro.EOL, event.getArgs()[0] ); event = it.next(); assertEquals( "text", event.getName() ); assertEquals( "paramName ---> paramValue" + Macro.EOL, event.getArgs()[0] ); event = it.next(); assertEquals( "verbatim_", event.getName() ); assertFalse( it.hasNext() ); }