code: public static Variable lookup(String varName, BindingSet bindingSet) {
          if (bindingSet == null) {
              return null;
          }
          Binding binding = bindingSet.lookup(varName);
          return (binding != null) ? binding.getVariable() : null;
      }
docs: Look up a variable definition in given BindingSet.
  
  @param varName
  the name of the variable
  @param bindingSet
  the BindingSet to look in
  @return the Variable, or null if no Variable is bound to the name