void handleRestore(final QueuedCommand queuedCommand) {
    throwIfNotConfigured();

    handleStatementWithTerminatedQueries(
        queuedCommand.getAndDeserializeCommand(commandDeserializer),
        queuedCommand.getAndDeserializeCommandId(),
        queuedCommand.getStatus(),
        Mode.RESTORE,
        queuedCommand.getOffset(),
        true
    );
  }
@Test
  public void shouldSetNextQueryIdToNextOffsetWhenExecutingRestoreCommand() {
    // Given:
    mockReplayCSAS(new QueryId("csas-query-id"));

    final Command command = new Command("CSAS", emptyMap(), emptyMap(), Optional.of(plan));
    when(commandDeserializer.deserialize(any(), any())).thenReturn(command);

    // When:
    statementExecutorWithMocks.handleRestore(
        new QueuedCommand(
            new CommandId(Type.STREAM, "foo", Action.CREATE),
            command,
            Optional.empty(),
            2L
        )
    );

    // Then:
    verify(mockQueryIdGenerator).setNextId(3L);
  }