### Question:
ZipCompressionOutputStream extends CompressionOutputStream { @Override public void addEntry( String filename, String extension ) throws IOException { int index = filename.lastIndexOf( Const.FILE_SEPARATOR ); String entryPath; if ( index != -1 ) { entryPath = filename.substring( index + 1 ); } else { entryPath = filename; } index = entryPath.toLowerCase().lastIndexOf( ".zip" ); if ( index != -1 ) { entryPath = entryPath.substring( 0, index ) + entryPath.substring( index + ".zip".length() ); } if ( !Utils.isEmpty( extension ) ) { entryPath += "." + extension; } ZipEntry zipentry = new ZipEntry( entryPath ); zipentry.setComment( "Compressed by Hop" ); ( (ZipOutputStream) delegate ).putNextEntry( zipentry ); } ZipCompressionOutputStream( OutputStream out, ICompressionProvider provider ); @Override void close(); @Override void addEntry( String filename, String extension );  }### Answer:
@Test public void testAddEntryAndWrite() throws IOException { ICompressionProvider provider = outStream.getCompressionProvider(); ByteArrayOutputStream out = new ByteArrayOutputStream(); outStream = new ZipCompressionOutputStream( out, provider ); outStream.addEntry( "./test.zip", null ); outStream.write( "Test".getBytes() ); }