public static SerdeFeatures buildValueFeatures(
      final LogicalSchema schema,
      final Format valueFormat,
      final SerdeFeatures explicitFeatures,
      final KsqlConfig ksqlConfig
  ) {
    final boolean singleColumn = schema.value().size() == 1;

    final ImmutableSet.Builder<SerdeFeature> builder = ImmutableSet.builder();

    getValueWrapping(singleColumn, valueFormat, explicitFeatures, ksqlConfig)
        .ifPresent(builder::add);

    return SerdeFeatures.from(builder.build());
  }
@Test
  public void shouldThrowIfWrapSingleValuePresentForFormatThatDoesNotSupportIt() {
    // When:
    final Exception e = assertThrows(
        KsqlException.class,
        () -> SerdeFeaturesFactory.buildValueFeatures(
            SINGLE_FIELD_SCHEMA,
            PROTOBUF,
            SerdeFeatures.of(SerdeFeature.UNWRAP_SINGLES),
            ksqlConfig
        )
    );

    // Then:
    assertThat(e.getMessage(), containsString("Format 'PROTOBUF' does not support 'WRAP_SINGLE_VALUE' set to 'false'."));
  }