I was wondering with the current java 1.7 implementation of the Random class, is it possible for the code below to generate two times the same random long?
Rando
It depends on which question you're asking.
As others have said: The standard formulas for pseudo-random number generators fully explore their value space before repeating.
However: In most applications we don't use the full range of the PRNG's output. We reduce it by dividing or truncating it down to a range that matches the problem we're trying to solve. And most of the ways we do so will, in fact, result in a series of numbers which can include immediate repeats.
And that could be true even if you're simply using an integer random number when the underlying formula is using more bits for its calculations.
So: Theoretically, if you're looking directly at a PRNG's output, the answer is "probably not". Practically, the answer is "don't count on it either way."