In the paper http://www.sciencedirect.com/science/article/pii/S0045782509003521, an HDG element-local equation is described on page 584 equation (4), with one of the equations taking the following form
$$-(u_h,\nabla q)_K = -\left\langle\hat{u}_h \cdot n, q - \bar{q}\right\rangle_{\partial K}$$
Which is the variational approximation to the continuous equation $\nabla \cdot u = 0$, with a scalar-valued test function $q$ in a space that makes sense.
The paper defines $$\bar{q} = \frac{1}{|\partial K|} \int_{\partial K} q $$.
How is this interpreted, in a finite element sense? From my understanding, we multiply both sides by a test function $q$ and then attempt to find the solution which satisfies the equation for all possible choices of $q$. How is it possible to modify the test space in this manner?
The paper also states that this is necessary to enforce the identity $$\left\langle\hat{u}_h\cdot n, q - \bar{q}\right\rangle_{\partial K} = 0$$ I agree with this statement, but how might a test function $q - \bar{q}$ be implemented in code? Should I take the basis functions on the element and subtract their mean when assembling the element local linear system?