code: public Set<String> getNames() {
          if (parent == null) {
              return getLocalNames();
          }
          Set<String> result = new TreeSet<>();
          result.addAll(parent.getNames());
          result.addAll(getLocalNames());
          return result;
      }
docs: Returns all names of variables known to this scope or one of its parent scopes.
  
  @return a set of all known variable names