fork download
  1. import java.util.*;
  2. class M{
  3. static void c(Map m){List t=new ArrayList(m.values());Collections.shuffle(t);Iterator i=t.iterator();for(Object k:m.keySet())m.put(k,i.next());}
  4.  
  5. public static void main(String[]a){
  6. for(int i=0;i<10;i++){
  7. Map m=new HashMap();
  8. m.put(0, 10);
  9. m.put(1, 10);
  10. m.put(5, 5);
  11. c(m);
  12. System.out.println(m);
  13. }
  14. }
  15. }
Success #stdin #stdout 0.04s 711168KB
stdin
Standard input is empty
stdout
{0=10, 1=5, 5=10}
{0=10, 1=10, 5=5}
{0=10, 1=5, 5=10}
{0=10, 1=10, 5=5}
{0=10, 1=5, 5=10}
{0=5, 1=10, 5=10}
{0=10, 1=10, 5=5}
{0=5, 1=10, 5=10}
{0=10, 1=10, 5=5}
{0=10, 1=10, 5=5}