### Question:
SparkRuntimeUtils { public static File createConfArchive(SparkConf sparkConf, final String propertiesEntryName, String confDirPath, final File zipFile) { final Properties properties = new Properties(); for (Tuple2<String, String> tuple : sparkConf.getAll()) { properties.put(tuple._1(), tuple._2()); } try { File confDir = new File(confDirPath); try (ZipOutputStream zipOutput = new ZipOutputStream(new FileOutputStream(zipFile))) { zipOutput.putNextEntry(new ZipEntry(propertiesEntryName)); properties.store(zipOutput, "Spark configuration."); zipOutput.closeEntry(); BundleJarUtil.addToArchive(confDir, zipOutput); } LOG.debug("Spark config archive created at {} from {}", zipFile, confDir); return zipFile; } catch (IOException e) { throw new RuntimeException(e); } }  static File createConfArchive(SparkConf sparkConf, final String propertiesEntryName,
                                       String confDirPath, final File zipFile); @SuppressWarnings("unused") static ParArray<T> setTaskSupport(ParArray<T> parArray); static void setLocalizedResources(Set<String> localizedResourcesNames,
                                           Map<String, String> configs); static Map<String, File> getLocalizedResources(File dir, SparkConf sparkConf); static SparkProgramCompletion initSparkMain(); static Closeable addEventLoggingListener(SparkRuntimeContext runtimeContext); static final String CDAP_SPARK_EXECUTION_SERVICE_URI; static final String PYSPARK_PORT_FILE_NAME; static final String PYSPARK_SECRET_FILE_NAME; }### Answer:
@Test public void testCreateConfArchive() throws IOException { File confDir = TEMP_FOLDER.newFolder(); File confFile = new File(confDir, "testing.conf"); Files.write("Testing Message", confFile, Charsets.UTF_8); SparkConf conf = new SparkConf(); conf.set("testing", "value"); File archiveFile = SparkRuntimeUtils.createConfArchive(conf, "test.properties", confDir.getAbsolutePath(), TEMP_FOLDER.newFile()); try (ZipFile zipFile = new ZipFile(archiveFile)) { Properties properties = new Properties(); try (InputStream is = zipFile.getInputStream(zipFile.getEntry("test.properties"))) { properties.load(is); Assert.assertEquals("value", properties.getProperty("testing")); } try (InputStream is = zipFile.getInputStream(zipFile.getEntry("testing.conf"))) { Assert.assertEquals("Testing Message", Bytes.toString(ByteStreams.toByteArray(is))); } } }