Permutation and rotation tests based on pairwise distance measures in high-dimensional data