### Question:
TrackedQueryManager { public boolean isQueryComplete(QuerySpec query) { if (this.includedInDefaultCompleteQuery(query.getPath())) { return true; } else if (query.loadsAllData()) { return false; } else { Map<QueryParams, TrackedQuery> trackedQueries = this.trackedQueryTree.get(query.getPath()); return trackedQueries != null && trackedQueries.containsKey(query.getParams()) && trackedQueries.get(query.getParams()).complete; } } TrackedQueryManager(
      PersistenceStorageEngine storageLayer, LogWrapper logger, Clock clock); TrackedQuery findTrackedQuery(QuerySpec query); void removeTrackedQuery(QuerySpec query); void setQueryActive(QuerySpec query); void setQueryInactive(QuerySpec query); void setQueryCompleteIfExists(QuerySpec query); void setQueriesComplete(Path path); boolean isQueryComplete(QuerySpec query); PruneForest pruneOldQueries(CachePolicy cachePolicy); Set<ChildKey> getKnownCompleteChildren(Path path); void ensureCompleteTrackedQuery(Path path); boolean hasActiveDefaultQuery(Path path); long countOfPrunableQueries();  }### Answer:
@Test public void isQueryComplete() { TrackedQueryManager manager = newManager(); manager.setQueryActive(SAMPLE_FOO_QUERY); manager.setQueryCompleteIfExists(SAMPLE_FOO_QUERY); manager.setQueryActive(DEFAULT_BAR_QUERY); manager.setQueryActive(defaultQueryAt("baz")); manager.setQueryCompleteIfExists(defaultQueryAt("baz")); assertTrue(manager.isQueryComplete(SAMPLE_FOO_QUERY)); assertFalse(manager.isQueryComplete(DEFAULT_BAR_QUERY)); assertFalse(manager.isQueryComplete(defaultQueryAt(""))); assertTrue(manager.isQueryComplete(defaultQueryAt("baz"))); assertTrue(manager.isQueryComplete(defaultQueryAt("baz/quu"))); }