code: public Variable[] promote() { 
          Scope parent = getParent();
          if (parent == null) {
              return new Variable[0];
          }
  
          Collection<Variable> promotion = new ArrayList<Variable>();
          
          // A set of variable names that have been moved into the promotion.
          Set<String> matchedNames = new HashSet<String>(7);
  
          intersectFrom(this, parent, matchedNames, promotion);
  
          Variable[] vars = new Variable[promotion.size()];
          return promotion.toArray(vars);
      }
docs: Returns variables to promote from this scope to a parent scope.
  Promote is similar to intersect, except it operates on this scope and
  its parent (if it has one).
  <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, promote does not alter the internal state of this
  scope or its parent.
  <p>
  This method is designed specifically for promoting the locally
  declared variables of a loop statement's body.
  
  @return variables to promote