### Question:
User implements UserIF, Serializable { @Override public void clearLog() { synchronized (this) { if (log == null) log = new HistoryMap(50, false); log.clear(); } } User();  User(NavigatorConfigurationIF navConf);  User(String userId, NavigatorConfigurationIF navConf); @Override String getId(); @Override UserFilterContextStore getFilterContext(); @Override HistoryMap getHistory(); @Override void setHistory(HistoryMap history); @Override Logger getLogger(); @Override List getLogMessages(); @Override void addLogMessage(String message); @Override void clearLog(); @Override synchronized void addWorkingBundle(String bundle_id, Object object); @Override synchronized Object getWorkingBundle(String bundle_id); @Override synchronized void removeWorkingBundle(String bundle_id); synchronized void setBundleExpiryAge(long bundleExpiryAge); synchronized void resetBundleExpiryAge(); @Override void setModel(String model); @Override String getModel(); @Override void setView(String view); @Override String getView(); @Override void setSkin(String skin); @Override String getSkin(); void setMVS(String model, String view, String skin);  }### Answer:
@Test public void testClearLog() { user.addLogMessage("log"); List log = user.getLogMessages(); user.clearLog(); Assert.assertTrue("retrieved log does not have a single message", log.size() == 1); Assert.assertTrue("retrieved log message is not 'log': " + log, log.get(0).equals("log")); log = user.getLogMessages(); Assert.assertTrue("cleared log is not empty", log.isEmpty()); }