public GzipHandler build(@Nullable Handler handler) {
        final ZipExceptionHandlingGzipHandler gzipHandler = new ZipExceptionHandlingGzipHandler();
        gzipHandler.setHandler(handler);
        gzipHandler.setMinGzipSize((int) minimumEntitySize.toBytes());
        gzipHandler.setInflateBufferSize((int) bufferSize.toBytes());
        gzipHandler.setDeflaterPool(new DeflaterPool(CompressionPool.DEFAULT_CAPACITY, deflateCompressionLevel, true));
        gzipHandler.setSyncFlush(syncFlush);

        if (compressedMimeTypes != null) {
            gzipHandler.setIncludedMimeTypes(compressedMimeTypes.toArray(new String[0]));
        }

        if (excludedMimeTypes != null) {
            gzipHandler.setExcludedMimeTypes(excludedMimeTypes.toArray(new String[0]));
        }

        if (includedMethods != null) {
            gzipHandler.setIncludedMethods(includedMethods.toArray(new String[0]));
        }

        if (excludedPaths != null) {
            gzipHandler.setExcludedPaths(excludedPaths.toArray(new String[0]));
        }

        if (includedPaths != null) {
            gzipHandler.setIncludedPaths(includedPaths.toArray(new String[0]));
        }

        return gzipHandler;
    }
@Test
    void testBuild() {
        final GzipHandler handler = gzip.build(null);

        assertThat(handler.getMinGzipSize()).isEqualTo((int) gzip.getMinimumEntitySize().toBytes());
        assertThat(handler.getIncludedMimeTypes()).containsOnly("text/plain");
        assertThat(handler.getIncludedMethods()).containsOnly("GET", "POST");
    }