A Nonparametric Test for Deviation from Randomness