### Question:
Instructions { void addInstructionSet (InstructionSet instructionSet) { String name = instructionSet.getName (); if (!mInstructionSets.containsKey (name)) { mInstructionSets.put (name, instructionSet); instructionSet.setup (); mExecutorCache.clear (); } else { throw new ExecutionException ("an instruction set '%s' is already registered", name); } } Instructions(ProcedureRunner runner, TestRunResultPublisher publisher);   }### Answer:
@Test public void testAddInstructionSet () { Instructions instructions = new Instructions (null, null); try { instructions.getExecutor (INSTRUCTION_NAME); fail ("no exception"); } catch (ExecutionException ee) { } try { instructions.getExecutor (INSTRUCTION_SET_NAME + "." + INSTRUCTION_NAME); fail ("no exception"); } catch (ExecutionException ee) { } InstructionSet instructionSet = new InstructionSetImpl (INSTRUCTION_SET_NAME); instructions.addInstructionSet (instructionSet); assertNotNull (instructions.getExecutor (INSTRUCTION_NAME)); assertNotNull (instructions.getExecutor (INSTRUCTION_SET_NAME + "." + INSTRUCTION_NAME)); assertNotNull (instructions.getExecutor (INSTRUCTION_NAME)); }
@Test public void testAddInstructionSetTwice () { Instructions instructions = new Instructions (null, null); instructions.addInstructionSet (new InstructionSetImpl (INSTRUCTION_SET_NAME)); try { instructions.addInstructionSet (new InstructionSetImpl (INSTRUCTION_SET_NAME)); fail ("no exception"); } catch (ExecutionException ee) { } }