### Question:
CompressionCustomizer implements HttpServerOptionsCustomizer { @Override public HttpServerOptions apply(HttpServerOptions options) { Compression compression = factory.getCompression(); if (compression != null) { options.setCompressionSupported(compression.getEnabled()); } return options; } CompressionCustomizer(AbstractConfigurableWebServerFactory factory); @Override HttpServerOptions apply(HttpServerOptions options);  }### Answer:
@Test public void shouldEnableCompression() { given(mockFactory.getCompression()).willReturn(mockCompression); given(mockCompression.getEnabled()).willReturn(true); CompressionCustomizer customizer = new CompressionCustomizer(mockFactory); customizer.apply(mockHttpServerOptions); verify(mockHttpServerOptions).setCompressionSupported(true); }
@Test public void shouldIgnoreNullCompression() { CompressionCustomizer customizer = new CompressionCustomizer(mockFactory); customizer.apply(mockHttpServerOptions); verify(mockHttpServerOptions, times(0)).setCompressionSupported(anyBoolean()); }