code: private static FlowScope unwrap(FlowScope scope) {
      while (scope instanceof RefinementTrackingFlowScope) {
        scope = ((RefinementTrackingFlowScope) scope).delegate;
      }
      return scope;
    }
docs: Unwraps any RefinementTrackingFlowScopes.