### Question:
TrackedQueryManager { public void setQueriesComplete(Path path) { this.trackedQueryTree .subtree(path) .foreach( new ImmutableTree.TreeVisitor<Map<QueryParams, TrackedQuery>, Void>() { @Override public Void onNodeValue( Path relativePath, Map<QueryParams, TrackedQuery> value, Void accum) { for (Map.Entry<QueryParams, TrackedQuery> e : value.entrySet()) { TrackedQuery trackedQuery = e.getValue(); if (!trackedQuery.complete) { saveTrackedQuery(trackedQuery.setComplete()); } } return null; } }); } 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 setQueriesComplete() { TrackedQueryManager manager = newManager(); manager.setQueryActive(defaultQueryAt("foo")); manager.setQueryActive(defaultQueryAt("foo/bar")); manager.setQueryActive(defaultQueryAt("elsewhere")); manager.setQueryActive(new QuerySpec(path("foo"), SAMPLE_QUERYPARAMS)); manager.setQueryActive(new QuerySpec(path("foo/baz"), SAMPLE_QUERYPARAMS)); manager.setQueryActive(new QuerySpec(path("elsewhere"), SAMPLE_QUERYPARAMS)); manager.setQueriesComplete(path("foo")); assertTrue(manager.findTrackedQuery(defaultQueryAt("foo")).complete); assertTrue(manager.findTrackedQuery(defaultQueryAt("foo/bar")).complete); assertTrue(manager.findTrackedQuery(new QuerySpec(path("foo"), SAMPLE_QUERYPARAMS)).complete); assertTrue( manager.findTrackedQuery(new QuerySpec(path("foo/baz"), SAMPLE_QUERYPARAMS)).complete); assertFalse(manager.findTrackedQuery(defaultQueryAt("elsewhere")).complete); assertFalse( manager.findTrackedQuery(new QuerySpec(path("elsewhere"), SAMPLE_QUERYPARAMS)).complete); manager.verifyCache(); }