public static StatementExecutorResponse execute(
      final ConfiguredStatement<ListTypes> configuredStatement,
      final SessionProperties sessionProperties,
      final KsqlExecutionContext executionContext,
      final ServiceContext serviceContext
  ) {
    final ImmutableMap.Builder<String, SchemaInfo> types = ImmutableMap.builder();

    final Iterator<CustomType> customTypes = executionContext.getMetaStore().types();
    while (customTypes.hasNext()) {
      final CustomType customType = customTypes.next();
      types.put(customType.getName(), EntityUtil.schemaInfo(customType.getType()));
    }

    return StatementExecutorResponse.handled(Optional.of(
        new TypeList(configuredStatement.getMaskedStatementText(), types.build())));
  }
@Test
  public void shouldListTypes() {
    // When:
    final Optional<KsqlEntity> entity = ListTypesExecutor.execute(
        ConfiguredStatement.of(PreparedStatement.of("statement", new ListTypes(Optional.empty())),
            SessionConfig.of(KSQL_CONFIG, ImmutableMap.of())),
        mock(SessionProperties.class),
        context,
        null
    ).getEntity();

    // Then:
    assertThat("expected a response", entity.isPresent());
    assertThat(((TypeList) entity.get()).getTypes(), is(ImmutableMap.of(
        "foo", EntityUtil.schemaInfo(SqlPrimitiveType.of(SqlBaseType.STRING))
    )));
  }