class TrackedQueryManager {

  public Set<ChildKey> getKnownCompleteChildren(Path path) {
    hardAssert(
        !this.isQueryComplete(QuerySpec.defaultQueryAtPath(path)), "Path is fully complete.");

    Set<ChildKey> completeChildren = new HashSet<ChildKey>();
    // First, get complete children from any queries at this location.
    Set<Long> queryIds = filteredQueryIdsAtPath(path);
    if (!queryIds.isEmpty()) {
      completeChildren.addAll(storageLayer.loadTrackedQueryKeys(queryIds));
    }

    // Second, get any complete default queries immediately below us.
    for (Map.Entry<ChildKey, ImmutableTree<Map<QueryParams, TrackedQuery>>> childEntry :
        this.trackedQueryTree.subtree(path).getChildren()) {
      ChildKey childKey = childEntry.getKey();
      ImmutableTree<Map<QueryParams, TrackedQuery>> childTree = childEntry.getValue();
      if (childTree.getValue() != null
          && HAS_DEFAULT_COMPLETE_PREDICATE.evaluate(childTree.getValue())) {
        completeChildren.add(childKey);
      }
    }

    return completeChildren;
  }

  public  TrackedQueryManager(
      PersistenceStorageEngine storageLayer, LogWrapper logger, Clock clock);

}