### Question:
MessageInstructionExecutor { @SuppressWarnings("InstanceofInterfaces") public Multimap<MessageGroup, Restful> execute(final InstructionSet instructionSet, PluginContext context) { final Multimap<MessageGroup, Restful> retVal = ArrayListMultimap.create(); final Map<String, Object> placeholderData = context.getPlaceholderData(); final Set<Instruction> mySet = instructionSet.getInstructions(); for (Instruction instruction : mySet) { if (instruction instanceof FreemarkerInstruction) { processFreemarkerInstruction(retVal, placeholderData, (FreemarkerInstruction) instruction); } else if (instruction instanceof FileInstruction) { processFileInstruction(retVal, placeholderData, (FileInstruction) instruction); } else if (instruction instanceof NodeFolderInstruction) { processFolderInstruction(retVal, placeholderData, (NodeFolderInstruction) instruction); } else if (instruction instanceof CndInstruction) { processCndInstruction(retVal, placeholderData, (CndInstruction) instruction); } else if (instruction instanceof XmlInstruction) { processXmlInstruction(retVal, placeholderData, (XmlInstruction) instruction); } else if (instruction instanceof ExecuteInstruction) { processXmlInstruction(retVal, placeholderData, (ExecuteInstruction) instruction); } else { retVal.put(MessageGroup.UNKNOWN, new MessageRestful(instruction.getMessage())); } } return retVal; }  @SuppressWarnings("InstanceofInterfaces") Multimap<MessageGroup, Restful> execute(final InstructionSet instructionSet, PluginContext context);  }### Answer:
@Test public void testParseInstructionSet() throws Exception { MessageInstructionExecutor executor = new MessageInstructionExecutor(); final InputStream resourceAsStream = getClass().getClassLoader().getResourceAsStream("parser_instructions.xml"); final String content = GlobalUtils.readStreamAsText(resourceAsStream); final Instructions instructions = parser.parseInstructions(content); final Set<InstructionSet> instructionSets = instructions.getInstructionSets(); assertEquals(3, instructionSets.size()); final Multimap<MessageGroup, Restful> messages = ArrayListMultimap.create(); for (InstructionSet instructionSet : instructionSets) { final Multimap<MessageGroup, Restful> m = executor.execute(instructionSet, getContext()); messages.putAll(m); } assertEquals(8, messages.size()); assertEquals(8, messages.keys().size()); }