public static KeyFormat sanitizeKeyFormat(
      final KeyFormat keyFormat,
      final List<SqlType> newKeyColumnSqlTypes,
      final boolean allowKeyFormatChangeToSupportNewKeySchema
  ) {
    return sanitizeKeyFormatWrapping(
        !allowKeyFormatChangeToSupportNewKeySchema ? keyFormat :
        sanitizeKeyFormatForTypeCompatibility(
            sanitizeKeyFormatForMultipleColumns(
                keyFormat,
                newKeyColumnSqlTypes.size()),
            newKeyColumnSqlTypes
        ),
        newKeyColumnSqlTypes.size() == 1
    );
  }
@Test
  public void shouldLeaveApplicableKeyWrappingUnchangedWhenSanitizing() {
    // Given:
    final KeyFormat format = KeyFormat.nonWindowed(
        FormatInfo.of(JsonFormat.NAME),
        SerdeFeatures.of(SerdeFeature.WRAP_SINGLES));

    // When:
    final KeyFormat sanitized = SerdeFeaturesFactory.sanitizeKeyFormat(format, SINGLE_SQL_TYPE, true);

    // Then:
    assertThat(sanitized.getFormatInfo(), equalTo(FormatInfo.of(JsonFormat.NAME)));
    assertThat(sanitized.getFeatures(), equalTo(SerdeFeatures.of(SerdeFeature.WRAP_SINGLES)));
  }