@Test void testAdd() { var block = new Block(new Label(0, "block")); block.add(dummyInstruction()); block.add(dummyInstruction()); assertEquals(2, block.getInstructions().size()); }
public void add(Instruction instruction) { if (instruction.getOwner() != null) { throw new IllegalArgumentException("The specified Instruction is already a child of another block.."); } instructions.add(instruction); instruction.setOwner(this); }
Block { public void add(Instruction instruction) { if (instruction.getOwner() != null) { throw new IllegalArgumentException("The specified Instruction is already a child of another block.."); } instructions.add(instruction); instruction.setOwner(this); } }
Block { public void add(Instruction instruction) { if (instruction.getOwner() != null) { throw new IllegalArgumentException("The specified Instruction is already a child of another block.."); } instructions.add(instruction); instruction.setOwner(this); }  }
Block { public void add(Instruction instruction) { if (instruction.getOwner() != null) { throw new IllegalArgumentException("The specified Instruction is already a child of another block.."); } instructions.add(instruction); instruction.setOwner(this); }  void add(Instruction instruction); void remove(Instruction instruction); Instruction last(); Instruction previous(Instruction instruction); }
Block { public void add(Instruction instruction) { if (instruction.getOwner() != null) { throw new IllegalArgumentException("The specified Instruction is already a child of another block.."); } instructions.add(instruction); instruction.setOwner(this); }  void add(Instruction instruction); void remove(Instruction instruction); Instruction last(); Instruction previous(Instruction instruction);  }