public static StatementExecutorResponse execute(
      final ConfiguredStatement<ListQueries> statement,
      final SessionProperties sessionProperties,
      final KsqlExecutionContext executionContext,
      final ServiceContext serviceContext
  ) {
    final RemoteHostExecutor remoteHostExecutor = RemoteHostExecutor.create(
        statement,
        sessionProperties,
        executionContext,
        serviceContext.getKsqlClient()
    );
    return statement.getStatement().getShowExtended()
        ? executeExtended(statement, sessionProperties, executionContext, remoteHostExecutor)
        : executeSimple(statement, executionContext, remoteHostExecutor);
  }
@Test
  public void shouldNotMergeDifferentQueryDescriptions() {
    // Given
    when(sessionProperties.getInternalRequest()).thenReturn(false);
    final ConfiguredStatement<?> showQueries = engine.configure("SHOW QUERIES EXTENDED;");
    final PersistentQueryMetadata localMetadata = givenPersistentQuery("id", RUNNING_QUERY_STATE);
    final PersistentQueryMetadata remoteMetadata = givenPersistentQuery("different id", ERROR_QUERY_STATE);

    
    when(mockKsqlEngine.getAllLiveQueries()).thenReturn(ImmutableList.of(localMetadata));
    when(mockKsqlEngine.getPersistentQueries()).thenReturn(ImmutableList.of(localMetadata));

    final Map<KsqlHostInfoEntity, KsqlQueryStatus> remoteMap = Collections.singletonMap(REMOTE_KSQL_HOST_INFO_ENTITY, KsqlQueryStatus.RUNNING);
    final List<QueryDescription> remoteQueryDescriptions = Collections.singletonList(
        QueryDescriptionFactory.forQueryMetadata(
            remoteMetadata,
            remoteMap)
    );
    when(remoteQueryDescriptionList.getQueryDescriptions()).thenReturn(remoteQueryDescriptions);
    when(ksqlEntityList.get(anyInt())).thenReturn(remoteQueryDescriptionList);
    when(response.getResponse()).thenReturn(ksqlEntityList);

    // When
    final QueryDescriptionList queries = (QueryDescriptionList) CustomExecutors.LIST_QUERIES.execute(
        showQueries,
        sessionProperties,
        mockKsqlEngine,
        serviceContext
    ).getEntity().orElseThrow(IllegalStateException::new);

    // Then
    assertThat(queries.getQueryDescriptions(),
        containsInAnyOrder(
            QueryDescriptionFactory.forQueryMetadata(localMetadata, LOCAL_KSQL_HOST_INFO_MAP),
            QueryDescriptionFactory.forQueryMetadata(remoteMetadata, remoteMap)));
  }