Generalized mode test