package nbmtools;

import java.io.IOException;
import java.io.InputStream;
import java.net.URI;
import java.util.List;
import java.util.stream.Collectors;
import org.apache.commons.io.IOUtils;
import scala.collection.JavaConversions;
import yokohama.unit.annotations.As;

@As
public class TestUtils {
    @As
    public static InputStream asInputStream(String s) throws IOException {
        return IOUtils.toInputStream(s, "UTF-8");
    }

    public static scala.collection.immutable.List<URI> uris(List<String> urls) {
        List<URI> uris =
                urls.stream().map(URI::create).collect(Collectors.toList());
        return JavaConversions.asScalaBuffer(uris).toList();
    }
}

@@ -12,16 +12,70 @@
 tools;%0A%0A
+import java.io.File;%0Aimport java.io.FileOutputStream;%0A
 import j
@@ -94,16 +94,16 @@
 eption;%0A
-
 import j
@@ -202,16 +202,54 @@
 ectors;%0A
+import java.util.zip.ZipOutputStream;%0A
 import o
@@ -709,16 +709,16 @@
 ist());%0A
-
         
@@ -775,11 +775,544 @@
 );%0A    %7D
+%0A%0A    public static void createZipFile(File file, List%3CZipEntry%3E entries)%0A            throws IOException %7B%0A        try(FileOutputStream fos = new FileOutputStream(file);%0A                ZipOutputStream zos = new ZipOutputStream(fos)) %7B%0A            for (ZipEntry entry : entries) %7B%0A                if (entry instanceof DirEntry) continue;%0A                FileEntry fileEntry = (FileEntry)entry;%0A%09%09%09%09zos.putNextEntry(fileEntry.getZipEntry());%0A                IOUtils.copy(fileEntry.getInputStream(), zos);%0A            %7D%0A        %7D%0A    %7D
 %0A%7D%0A

Add createZipFile utility method