public long getNextLong() {
    long randomLong = rand.nextLong();

    return randomLong == Long.MIN_VALUE ? 0 : Math.abs(randomLong);
  }
Simple utility to generate random values.
samza-tools/src/main/java/org/apache/samza/tools/RandomValueGenerator.java