### Question:
KeyToIdMap { public void add(@NonNull DownloadTask task, int id) { final String key = generateKey(task); keyToIdMap.put(key, id); idToKeyMap.put(id, key); } KeyToIdMap();   KeyToIdMap(@NonNull HashMap<String, Integer> keyToIdMap,
               @NonNull SparseArray<String> idToKeyMap); @Nullable Integer get(@NonNull DownloadTask task); void remove(int id); void add(@NonNull DownloadTask task, int id);  }### Answer:
@Test public void add() { final String key = map.generateKey(task); map.add(task, 1); assertThat(keyToIdMap).containsKeys(key); assertThat(keyToIdMap).containsValues(1); assertThat(idToKeyMap.size()).isOne(); assertThat(idToKeyMap.get(1)).isEqualTo(key); }