code: public Variable[] intersect(Scope scope) {
          Collection<Variable> intersection = new ArrayList<Variable>();
          
          // A set of variable names that have been moved into the intersection.
          Set<String> matchedNames = new HashSet<String>(7);
  
          intersectFrom(this, scope, matchedNames, intersection);
          intersectFrom(scope, this, matchedNames, intersection);
  
          Variable[] vars = new Variable[intersection.size()];
          return intersection.toArray(vars);
      }
docs: Returns the intersection of this scope against the one given. An
  intersection operates on each scope's locally declared variables,
  producing a list of variables that both scopes may inherit.
  <p>
  The list may contain undeclared variables, and so all returned variables
  must be re-declared in a common parent scope. This responsibility is
  left to the caller, intersect does not alter the internal state of
  either scope.
  <p>
  This method is designed specifically for combining the locally
  declared variables of the "then" and "else" parts of an if statement.
  
  @return variables representing the intersection