The probability weighted characteristic function and goodness-of-fit testing