### Question:
JavacUtil { public static boolean compile(String source, String destDir) { if ( !isJavacReady ) { return false; } try { javacCommands[4] = source; javacCommands[6] = destDir; Process p = Runtime.getRuntime().exec(javacCommands); int response = 0; try { response = p.waitFor(); } catch (InterruptedException e) { } InputStream is = p.getErrorStream(); byte[] buf = IOUtil.readStreamBytes(is); if ( response != 0 && buf != null ) { String errMsg = new String(buf); if ( log.isDebugEnabled() ) { log.debug(errMsg); } return false; } if ( log.isDebugEnabled() ) { log.debug("Compile the " + source + " to " + destDir + " succeed. "); } return true; } catch (IOException e) { log.error("Failed to compile source : " + source, e); e.printStackTrace(); } return false; }  static boolean compile(String source, String destDir);  }### Answer:
@Test public void testCompile() { File destFile = new File(destDir); File classFile = new File(destDir, "com/xinqihd/test/Hello.class"); destFile.mkdirs(); assertTrue(JavacUtil.compile(source, destDir)); assertTrue(classFile.exists()); }