code: public Set<String> getIdsForIdWithAncestors(String termId) {
          if (!terms.containsKey(termId))
              return new HashSet<String>();
          Stack<String> idsToConsider = new Stack<String>();
          idsToConsider.add(termId);
          Set<String> resultIds = new HashSet<String>();
          while (!idsToConsider.isEmpty()) {
              String id = idsToConsider.pop();
              if (!resultIds.contains(id)) {
                  resultIds.add(id);
                  idsToConsider.addAll(terms.get(id).getIsA());
              }
          }
          return resultIds;
      }
docs: Given a single ID, return that ID, its parents, grandparents etc.
  
  @param termId
  The initial "seed" ID.
  @return The full set of IDs.