### Question:
PersistenceService { public Map<String, Object> getTableCounts() { Map<String, Object> ret = new LinkedHashMap<>(); List<String> tableNames = jdbcContentPersistenceService.getAllTableNames(); Collections.sort(tableNames); for (String tableName: tableNames) { try { ret.put(tableName, jdbcContentPersistenceService.rowCount(tableName)); } catch (Throwable e) { ret.put(tableName, "ERROR: " + e.getMessage()); } } return ret; }  Map<String, Object> getTableCounts();  }### Answer:
@Test public void getCountsFromTables() { Map<String, Object> data1 = new HashMap<>(); data1.put("key1", "value1"); PersistenceService tested = getTested(); tested.jdbcContentPersistenceService.store("id1", "type1", data1); Map<String, Object> result = tested.getTableCounts(); Assert.assertEquals(1 + 6, result.keySet().size()); String tableName = "data_type1"; Assert.assertEquals(1, result.get(tableName)); clearDatabase(); }