### Question:
DefaultNewsService implements NewsService { @Override public void clear() { Preferences prefs = Preferences.userRoot().node(NEWS_PATH); try { prefs.removeNode(); prefs.flush(); } catch (BackingStoreException e) { LOG.error("Unable to clear latest news store", e); } } @Inject  DefaultNewsService(Pdfsam pdfsam); @Override List<NewsData> getLatestNews(); @Override int getLatestNewsSeen(); @Override void setLatestNewsSeen(int id); @Override int getLatestImportantNewsSeen(); @Override void setLatestImportantNewsSeen(int id); @Override void clear();  }### Answer:
@Test public void testClear() { victim.setLatestNewsSeen(5); assertEquals(5, victim.getLatestNewsSeen()); victim.clear(); assertEquals(-1, victim.getLatestNewsSeen()); }