### Question:
EVM { @VisibleForTesting Operation operationAtOffset(final Code code, final int contractAccountVersion, final int offset) { final Bytes bytecode = code.getBytes(); if (offset >= bytecode.size()) { return endOfScriptStop; } final byte opcode = bytecode.get(offset); final Operation operation = operations.get(opcode, contractAccountVersion); if (operation == null) { return new InvalidOperation(opcode, null); } else { return operation; } } EVM(final OperationRegistry operations, final GasCalculator gasCalculator); void runToHalt(final MessageFrame frame, final OperationTracer operationTracer);  }### Answer:
@Test public void assertThatEndOfScriptNotExplicitlySetInCodeReturnsAVirtualOperation() { final Code code = new Code(Bytes.fromHexString("0x60203560003555606035604035556000")); final Operation operation = evm.operationAtOffset(code, CONTRACT_ACCOUNT_VERSION, code.getSize()); assertThat(operation).isNotNull(); assertThat(operation.isVirtualOperation()).isTrue(); }
@Test public void assertThatEndOfScriptExplicitlySetInCodeDoesNotReturnAVirtualOperation() { final Code code = new Code(Bytes.fromHexString("0x6020356000355560603560403555600000")); when(operationRegistry.get(anyByte(), eq(CONTRACT_ACCOUNT_VERSION))) .thenReturn(new StopOperation(gasCalculator)); final Operation operation = evm.operationAtOffset(code, CONTRACT_ACCOUNT_VERSION, code.getSize() - 1); assertThat(operation).isNotNull(); assertThat(operation.isVirtualOperation()).isFalse(); }