@Test public void call() { Matcher matcher = mock(Matcher.class); Instruction instruction = Instruction.call(42, matcher); assertThat(instruction).isInstanceOf(CallInstruction.class); assertThat(instruction.toString()).isEqualTo("Call 42"); assertThat(instruction.equals(Instruction.call(42, matcher))).isTrue(); assertThat(instruction.equals(Instruction.call(42, mock(Matcher.class)))).isFalse(); assertThat(instruction.equals(Instruction.call(13, matcher))).isFalse(); assertThat(instruction.equals(new Object())).isFalse(); assertThat(instruction.hashCode()).isEqualTo(42); instruction.execute(machine); InOrder inOrder = Mockito.inOrder(machine); inOrder.verify(machine).pushReturn(1, matcher, 42); verifyNoMoreInteractions(machine); }
public static Instruction call(int offset, Matcher matcher) { return new CallInstruction(offset, matcher); }
Instruction { public static Instruction call(int offset, Matcher matcher) { return new CallInstruction(offset, matcher); } }
Instruction { public static Instruction call(int offset, Matcher matcher) { return new CallInstruction(offset, matcher); }  }
Instruction { public static Instruction call(int offset, Matcher matcher) { return new CallInstruction(offset, matcher); }  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 call(int offset, Matcher matcher) { return new CallInstruction(offset, matcher); }  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);  }