public static KTableHolder<GenericKey> build(
      final KGroupedTableHolder groupedTable,
      final TableAggregate aggregate,
      final RuntimeBuildContext buildContext,
      final MaterializedFactory materializedFactory) {
    return build(
        groupedTable,
        aggregate,
        buildContext,
        materializedFactory,
        new AggregateParamsFactory()
    );
  }
@Test
  public void shouldBuildMaterializationCorrectlyForAggregate() {
    // When:
    final KTableHolder<?> result = aggregate.build(planBuilder, planInfo);

    // Then:
    assertThat(result.getMaterializationBuilder().isPresent(), is(true));

    final MaterializationInfo info = result.getMaterializationBuilder().get().build();
    assertThat(info.stateStoreName(), equalTo("agg-regate-Materialize"));
    assertThat(info.getSchema(), equalTo(AGGREGATE_SCHEMA));
    assertThat(info.getStateStoreSchema(), equalTo(AGGREGATE_SCHEMA));
    assertThat(info.getTransforms(), hasSize(1));

    final MapperInfo aggMapInfo = (MapperInfo) info.getTransforms().get(0);
    final KsqlTransformer<Object, GenericRow> mapper = aggMapInfo.getMapper(name -> null);

    // Given:
    final GenericKey key = mock(GenericKey.class);
    final GenericRow value = mock(GenericRow.class);

    // When:
    mapper.transform(key, value, ctx);

    // Then:
    verify(resultMapper).transform(key, value, ctx);
  }