@Test
public void mergeToSeparateFile()
    throws Exception
{

    List<String> files =
        Arrays.asList( "target/test-classes/META-INF/LICENSE", "target/test-classes/META-INF/LICENSE.txt" );
    MergeFilesTransformer mergeFilesTransformer = new MergeFilesTransformer( files, "LICENSE", false );
    Path result = Files.createTempFile( "result_transform", ".jetty_tmp.zip" );
    try (JarOutputStream outputStream = new JarOutputStream( Files.newOutputStream( result ) ))
    {
        mergeFilesTransformer.modifyOutputStream( outputStream );
    }
    try (JarInputStream jarInputStream = new JarInputStream( Files.newInputStream( result ) ))
    {
        jarInputStream.getNextJarEntry();
        StringWriter stringWriter = new StringWriter();
        IOUtil.copy( jarInputStream, stringWriter );
        String content = stringWriter.toString();
        // must contain
        // COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0
        Assertions.assertTrue(
            content.contains( "COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0" ) );
        // Apache License
        Assertions.assertTrue( content.contains( "Apache License" ) );
        Assertions.assertTrue( content.contains( "Version 2.0, January 2004"));
        Assertions.assertTrue( content.contains( "\"CLASSPATH\" EXCEPTION TO THE GPL VERSION 2"));
        // Eclipse Public License - v 1.0
        Assertions.assertTrue( content.contains( "Eclipse Public License - v 1.0" ) );
    } finally
    {
        Files.deleteIfExists( result );
    }
}