code: public String dummyVariable() {
          StringBuilder buf = new StringBuilder();
          buf.append("$_");
          buf.append(dummyVariableCount++);
          return buf.toString();
      }
docs: Get a dummy variable name. The name returned will begin with the
  <code>'$'</code> character, and will be different than any previous dummy
  variable name allocated by this object. Dummy variable names are useful
  for creating PatternElements where you don't care whether the value it
  uses is the same as one used by another PatternElement.