code: public Collection<Variable> getVariables() {
          if (parent == null) {
              return getLocalVariables();
          }
          List<Variable> result = new ArrayList<>();
          result.addAll(parent.getVariables());
          result.addAll(getLocalVariables());
          return result;
      }
docs: Returns all variables known to this scope or one of its parent scopes.
  
  @return a collection of all known variables