public void verifyNonEmptyJokeString() { Joker j = new Joker(); j.execute(); Object objLock = new Object(); synchronized (objLock) { try { objLock.wait(2000); } catch (InterruptedException e) { e.printStackTrace(); } } assertNotNull("Error #1: No joke told", j.theJoke); }