/* package whatever; // don't place package name! */
import java.util.Arrays;
import java.util.function.Consumer;
/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
public static void main
(String[] args
){ int[] array = {1,2,3,4,5,6,7,8,9,10};
new Ideone().a.accept(array);
}
Consumer
<int[]> a
= a
->{for(int b
=0,c,d
=0,e
=a.
length;b
<e
;c
=a
[b
],a
[b
]=a
[d
],a
[d
]=c,b
++,d
=b
)d
+=Math.
random()*(e
-b
);};}
LyogcGFja2FnZSB3aGF0ZXZlcjsgLy8gZG9uJ3QgcGxhY2UgcGFja2FnZSBuYW1lISAqLwoKaW1wb3J0IGphdmEudXRpbC5BcnJheXM7CmltcG9ydCBqYXZhLnV0aWwuZnVuY3Rpb24uQ29uc3VtZXI7CgovKiBOYW1lIG9mIHRoZSBjbGFzcyBoYXMgdG8gYmUgIk1haW4iIG9ubHkgaWYgdGhlIGNsYXNzIGlzIHB1YmxpYy4gKi8KY2xhc3MgSWRlb25lCnsKCQogICAgcHVibGljIHN0YXRpYyB2b2lkIG1haW4oU3RyaW5nW10gYXJncyl7CiAgICAgICAgaW50W10gYXJyYXkgPSB7MSwyLDMsNCw1LDYsNyw4LDksMTB9OwogICAgICAgIG5ldyBJZGVvbmUoKS5hLmFjY2VwdChhcnJheSk7CiAgICAgICAgU3lzdGVtLm91dC5wcmludGxuKEFycmF5cy50b1N0cmluZyhhcnJheSkpOwogICAgfQoKICAgIENvbnN1bWVyPGludFtdPiBhID0gYS0+e2ZvcihpbnQgYj0wLGMsZD0wLGU9YS5sZW5ndGg7YjxlO2M9YVtiXSxhW2JdPWFbZF0sYVtkXT1jLGIrKyxkPWIpZCs9TWF0aC5yYW5kb20oKSooZS1iKTt9Owp9
[2, 4, 3, 9, 6, 7, 8, 5, 10, 1]