@Test
public void testMakeLabelMap() {

    List<Instruction> instructions = Arrays.asList(
            new Instruction(InstructionType.INSTRUCTION, "init", Assembler.opcodes.get("ldc"), 89L, null, null, null, 1),
            new Instruction(InstructionType.INSTRUCTION, "~configuration", Assembler.opcodes.get("confio"), null, null, null, null, 2),
            new Instruction(InstructionType.INSTRUCTION, "alabel", Assembler.opcodes.get("ajw"), -10L, null, null, null, 3),
            new Instruction(InstructionType.INSTRUCTION, null, Assembler.opcodes.get("ldlp"), 0L, null, null, null, 4),
            new Instruction(InstructionType.INSTRUCTION, "justcomment", null, null, null, null, null, 5),
            new Instruction(InstructionType.INSTRUCTION, "jump", Assembler.opcodes.get("j"), null, "~configuration", null, null, 6),
            new Instruction(InstructionType.INSTRUCTION, "~end", null, null, null, "exit program", null, 7)
    );
    Assembly labelMappedAssembly = Assembler.makeLabelMap(instructions);
    assertEquals(new Long(0), labelMappedAssembly.labelMap.get("init"));
    assertEquals(new Long(1), labelMappedAssembly.labelMap.get("~configuration"));
    assertEquals(new Long(2), labelMappedAssembly.labelMap.get("alabel"));
    assertEquals(new Long(4), labelMappedAssembly.labelMap.get("justcomment"));
    assertEquals(new Long(4), labelMappedAssembly.labelMap.get("jump"));
    assertEquals(new Long(5), labelMappedAssembly.labelMap.get("~end"));
    // The label/comment-only instructions should be eliminated
    assertEquals(5, labelMappedAssembly.instructions.size());
}