Example usage for java.util Random ints

List of usage examples for java.util Random ints

Introduction

In this page you can find the example usage for java.util Random ints.

Prototype

public IntStream ints() 

Source Link

Document

Returns an effectively unlimited stream of pseudorandom int values.

Usage

From source file:ai.grakn.test.graql.shell.GraqlShellIT.java

private static String randomString(int length) {
    Random random = new Random();
    StringBuilder sb = new StringBuilder();

    random.ints().limit(length).forEach(i -> sb.append((char) i));

    return sb.toString();
}