### Question:
ThemeArchive { public ThemeModifier extract(File themeDirectory) throws IOException { checkZippedThemeIsSet(); FileUtils.deleteDirectory(themeDirectory); try (ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(zippedTheme)) { UnzipUtil.unzip(byteArrayInputStream, themeDirectory.getPath()); } return new ThemeModifier(themeDirectory); } ThemeArchive();  ThemeArchive(byte[] zippedTheme); void setZippedTheme(byte[] zippedTheme); ThemeModifier extract(File themeDirectory); byte[] asByteArray();  }### Answer:
@Test public void should_extract_the_given_zip_into_destination_folder() throws Exception { final ThemeArchive themeArchive = new ThemeArchive(createStyleFiles("bonita.css")); themeArchive.extract(themeDirectory); assertThat(themeDirectory.list()).containsOnly("bonita.css"); }
@Test public void should_add_given_file_to_theme_directory() throws Exception { final ThemeArchive themeArchive = new ThemeArchive(createStyleFiles("bonita.css")); themeArchive.extract(themeDirectory).add("style.css", "body {}".getBytes()); assertThat(themeDirectory.list()).containsOnly("bonita.css", "style.css"); }
@Test public void should_compile_given_file_into_theme_directory() throws Exception { final ThemeArchive themeArchive = new ThemeArchive( createStyleFiles("style1.less", "style2.less", "style3.css")); themeArchive.extract(themeDirectory).compile( new CompilableFile("style1.less", "style1.css"), new CompilableFile("style2.less", "style2.css")); assertThat(themeDirectory.list()).containsOnly( "style1.less", "style1.css", "style2.less", "style2.css", "style3.css"); }
@Test public void should_replace_old_directory_with_zip_content() throws Exception { themeDirectory.mkdirs(); new File(themeDirectory, "old-style.css").createNewFile(); final ThemeArchive themeArchive = new ThemeArchive(createStyleFiles("bonita.css")); themeArchive.extract(themeDirectory); assertThat(themeDirectory.list()).containsOnly("bonita.css"); }