### Question:
PreferencesUsageDataStore { public List<ModuleUsage> getUsages() { Preferences prefs = Preferences.userRoot().node(USAGE_PATH); List<ModuleUsage> retList = new ArrayList<>(); try { List<String> jsons = Arrays.stream(prefs.childrenNames()).parallel().map(name -> prefs.node(name)) .map(node -> node.get(MODULE_USAGE_KEY, "")).filter(json -> isNotBlank(json)).collect(toList()); for (String json : jsons) { retList.add(JSON.std.beanFrom(ModuleUsage.class, json)); } } catch (BackingStoreException | IOException e) { LOG.error("Unable to get modules usage statistics", e); } return retList; } PreferencesUsageDataStore(); void incrementUsageFor(String moduleId); List<ModuleUsage> getUsages(); void clear(); long getTotalUsage(); @EventListener void onShutdown(ShutdownEvent event); void flush();  }### Answer:
@Test public void getUsages() { victim.incrementUsageFor("module1"); victim.incrementUsageFor("module1"); victim.incrementUsageFor("module2"); List<ModuleUsage> result = victim.getUsages(); assertEquals(2, result.size()); }