### Question:
RuntimeBean implements CommandListener { @Command public String threads() { final StringBuilder sb = new StringBuilder(); final Set<Thread> threads = Thread.getAllStackTraces().keySet(); for (Thread thread : threads) { sb.append("{ id: \"" + thread.getId() + "\"") .append(" name: \"" + thread.getName() + "\"") .append(" state: \"" + thread.getState() + "\"") .append(" priority: \"" + thread.getPriority() + "\"") .append(" group: \"" + (thread.getThreadGroup() != null ? thread.getThreadGroup().getName() : "none") + "\" }") .append("\n"); } return sb.toString(); }  @Command void gc(); @Command String freeMemory(@Option({"unit", "u"}) @Default("MEGABYTES") SizeUnit unit); @Command String maxMemory(@Option({"unit","u"}) @Default("MEGABYTES") SizeUnit unit); @Command String totalMemory(@Option({"unit","u"}) @Default("MEGABYTES") SizeUnit unit); @Command String threads();  }### Answer:
@Test public void testThreads() throws Exception { final String threads = (String) main.exec("threads"); assertNotNull(threads); }