### Question:
GoogleJobStore extends JobStoreWithValidator { @Override public Map<String, Integer> getCounts(UUID jobId) { Query<Entity> query = getCountsQuery(jobId); QueryResults<Entity> results = datastore.run(query); ImmutableMap.Builder<String, Integer> countsMapBuilder = ImmutableMap.builder(); while (results.hasNext()) { Entity result = results.next(); String dataType = result.getKey().getName(); long count = result.getLong(COUNTS_FIELD); countsMapBuilder.put(dataType, (int) count); } return countsMapBuilder.build(); } @Inject  GoogleJobStore(
      Datastore datastore, GoogleTempFileStore googleTempFileStore, ObjectMapper objectMapper); @Override void createJob(UUID jobId, PortabilityJob job); @Override void updateJob(UUID jobId, PortabilityJob job); @Override void addErrorsToJob(UUID jobId, Collection<ErrorDetail> errors); @Override void remove(UUID jobId); @Override PortabilityJob findJob(UUID jobId); @Override UUID findFirst(JobAuthorization.State jobState); @Override void create(UUID jobId, String key, T model); @Override void update(UUID jobId, String key, T model); @Override T findData(UUID jobId, String key, Class<T> type); @Override void create(UUID jobId, String key, InputStream stream); @Override void addCounts(UUID jobId, Map<String, Integer> newCounts); @Override Map<String, Integer> getCounts(UUID jobId); @Override InputStreamWrapper getStream(UUID jobId, String key);  }### Answer:
@Test public void canAddNewKeysToTheCurrentCountsTest() throws IOException { addItemToJobStoreCounts(ITEM_NAME); final Map<String, Integer> counts = googleJobStore.getCounts(JOB_ID); Truth.assertThat(counts.size()).isEqualTo(1); Truth.assertThat(counts.get(ITEM_NAME)).isEqualTo(1); }
@Test public void canAddExistingKeysToCurrentCountsTest() throws IOException { addItemToJobStoreCounts(ITEM_NAME); addItemToJobStoreCounts(ITEM_NAME); final Map<String, Integer> counts = googleJobStore.getCounts(JOB_ID); Truth.assertThat(counts.size()).isEqualTo(1); Truth.assertThat(counts.get(ITEM_NAME)).isEqualTo(2); }