code: protected ExpectState prepareClosure(int pairIndex, String buffer) {
          ExpectState state;
          Map<String, Object> prevMap = null;
          if (g_state != null) {
              prevMap = g_state.getVars();
          }
  
          state = new ExpectState(pairIndex, buffer, prevMap);
  
          return state;
      }
docs: TODO
  
  @param pairIndex TODO
  @param buffer TODO
  @return TODO