### Question:
SystemMonitor extends QBeanSupport implements Runnable, SystemMonitorMBean, Loggeable { void showThreadGroup(ThreadGroup g, PrintStream p, String indent) { if (g.getParent() != null) showThreadGroup(g.getParent(), p, indent + " "); else dumpThreads(g, p, indent + " "); }  void startService(); void stopService(); synchronized void setSleepTime(long sleepTime); synchronized long getSleepTime(); synchronized void setDetailRequired(boolean detail); synchronized boolean getDetailRequired(); void run(); void dump(PrintStream p, String indent); @Override void setConfiguration(Configuration cfg);  }### Answer:
@Test public void testShowThreadGroupThrowsNullPointerException() throws Throwable { assertThrows(NullPointerException.class, () -> { String indent = "++"; systemMonitor.showThreadGroup(null, printStream, indent); }); }
@Test public void testShowThreadGroup() throws Throwable { String indent = "++"; systemMonitor.showThreadGroup(threadGroup, printStream, indent); assertThat(baos.toString(), is("")); }