### Question:
DailyTaskAdaptor extends QBeanSupport implements Runnable { public void run () { while (running()) { waitUntilStartTime(); if (running()) { Thread taskThread = new Thread(task); taskThread.setDaemon (true); taskThread.start(); ISOUtil.sleep (1000); } } } DailyTaskAdaptor(); void run(); Date getWhen();  }### Answer:
@Test public void testRun() throws Throwable { DailyTaskAdaptor dailyTaskAdaptor = new DailyTaskAdaptor(); dailyTaskAdaptor.run(); assertNull(dailyTaskAdaptor.getConfiguration(), "dailyTaskAdaptor.getConfiguration()"); }
@Test public void testRunThrowsNullPointerException() throws Throwable { DailyTaskAdaptor dailyTaskAdaptor = new DailyTaskAdaptor(); dailyTaskAdaptor.setState(2); try { dailyTaskAdaptor.run(); fail("Expected NullPointerException to be thrown"); } catch (NullPointerException ex) { if (isJavaVersionAtMost(JAVA_14)) { assertNull(ex.getMessage(), "ex.getMessage()"); } else { assertEquals("Cannot invoke \"org.jpos.core.Configuration.get(String)\" because \"this.cfg\" is null", ex.getMessage(), "ex.getMessage()"); } assertNull(dailyTaskAdaptor.getConfiguration(), "dailyTaskAdaptor.getConfiguration()"); } }
@Test public void testRunThrowsNumberFormatException() throws Throwable { Configuration cfg = new SimpleConfiguration(); DailyTaskAdaptor dailyTaskAdaptor = new DailyTaskAdaptor(); dailyTaskAdaptor.setState(2); dailyTaskAdaptor.setConfiguration(cfg); try { dailyTaskAdaptor.run(); fail("Expected NumberFormatException to be thrown"); } catch (NumberFormatException ex) { assertEquals("For input string: \":0\"", ex.getMessage(), "ex.getMessage()"); assertSame(cfg, dailyTaskAdaptor.getConfiguration(), "dailyTaskAdaptor.getConfiguration()"); } }