Simple implementation of using Java's random number class