### Question:
ConfigurationJsonTool { public static void main(String[] args) { String programName = System.getProperty("script", "ConfigurationJsonTool"); Set<String> validArgument = Sets.newHashSet(); validArgument.add(CDAP_CONFIG); validArgument.add(SECURITY_CONFIG); if (args.length != 1 || !(validArgument.contains(args[0]))) { System.err.println(String.format("Usage: %s (%s | %s)", programName, CDAP_CONFIG, SECURITY_CONFIG)); System.exit(1); } PrintStream stdout = System.out; System.setOut(new PrintStream(new NullOutputStream())); StringBuilder output = new StringBuilder(); exportToJson(args[0], output); System.setOut(stdout); System.out.print(output); }  static void exportToJson(Configuration configuration, Appendable output); static void main(String[] args);  }### Answer:
@Test public void testLogSuppress() throws UnsupportedEncodingException { PrintStream stdout = System.out; ByteArrayOutputStream os = new ByteArrayOutputStream(); System.setOut(new PrintStream(os, true, "UTF-8")); try { ConfigurationJsonTool.main(new String[]{"--cdap"}); } finally { System.setOut(stdout); } new Gson().fromJson(os.toString("UTF-8"), JsonObject.class); }