grouping test. Take a look at grouping.cpp for details.