@Test public void ret() { Instruction instruction = Instruction.ret(); assertThat(instruction).isInstanceOf(RetInstruction.class); assertThat(instruction.toString()).isEqualTo("Ret"); assertThat(instruction).as("singleton").isSameAs(Instruction.ret()); MachineStack stack = mock(MachineStack.class); when(stack.address()).thenReturn(42); when(stack.isIgnoreErrors()).thenReturn(true); when(machine.peek()).thenReturn(stack); instruction.execute(machine); InOrder inOrder = Mockito.inOrder(machine); inOrder.verify(machine).createNode(); inOrder.verify(machine).peek(); inOrder.verify(machine).setIgnoreErrors(true); inOrder.verify(machine).setAddress(42); inOrder.verify(machine).popReturn(); verifyNoMoreInteractions(machine); }
public static Instruction ret() { return RET; }
Instruction { public static Instruction ret() { return RET; } }
Instruction { public static Instruction ret() { return RET; }  }
Instruction { public static Instruction ret() { return RET; }  static void addAll(List<Instruction> list, Instruction[] array); static Instruction jump(int offset); static Instruction call(int offset, Matcher matcher); static Instruction ret(); static Instruction backtrack(); static Instruction end(); static Instruction choice(int offset); static Instruction predicateChoice(int offset); static Instruction commit(int offset); static Instruction commitVerify(int offset); static Instruction failTwice(); static Instruction backCommit(int offset); static Instruction ignoreErrors(); abstract void execute(Machine machine); }
Instruction { public static Instruction ret() { return RET; }  static void addAll(List<Instruction> list, Instruction[] array); static Instruction jump(int offset); static Instruction call(int offset, Matcher matcher); static Instruction ret(); static Instruction backtrack(); static Instruction end(); static Instruction choice(int offset); static Instruction predicateChoice(int offset); static Instruction commit(int offset); static Instruction commitVerify(int offset); static Instruction failTwice(); static Instruction backCommit(int offset); static Instruction ignoreErrors(); abstract void execute(Machine machine);  }