### Question:
PreferencesUsageDataStore { public void incrementUsageFor(String moduleId) { Preferences node = Preferences.userRoot().node(USAGE_PATH).node(moduleId); String json = node.get(MODULE_USAGE_KEY, ""); try { if (isNotBlank(json)) { node.put(MODULE_USAGE_KEY, JSON.std.asString(JSON.std.beanFrom(ModuleUsage.class, json).inc())); } else { node.put(MODULE_USAGE_KEY, JSON.std.asString(ModuleUsage.fistUsage(moduleId))); } LOG.trace("Usage incremented for module {}", moduleId); } catch (IOException e) { LOG.error("Unable to increment modules usage statistics", e); } finally { incrementTotalUsage(); } } PreferencesUsageDataStore(); void incrementUsageFor(String moduleId); List<ModuleUsage> getUsages(); void clear(); long getTotalUsage(); @EventListener void onShutdown(ShutdownEvent event); void flush();  }### Answer:
@Test public void incrementUsageFor() throws JSONObjectException, IOException { victim.incrementUsageFor("moduleId"); ModuleUsage usage = JSON.std.beanFrom( ModuleUsage.class, Preferences.userRoot().node(PreferencesUsageDataStore.USAGE_PATH).node("moduleId") .get(PreferencesUsageDataStore.MODULE_USAGE_KEY, "")); assertEquals(1, usage.getTotalUsed()); assertTrue(usage.getLastSeen() != 0); }