It should be random.nextDouble() < samplingRate as it's nextDouble returns range [0, 1) with 0.0d (inclusive) and 1.0d (exclusive)