title: How to generate the random values of map from a given set of values and then store the key and values into separate variables in scala
body: <p>I am trying to generate the 1000 random key-val map pairs from the given(statically defined) 2 map key-val pairs in scala and also later i would want to break the key and value pairs and store them into separate variables</p>
  <p>Whatever i have tried:</p>
  <pre><code>object methodTest extends App{
  
    val testMap = Map(&quot;3875835&quot;-&gt;&quot;ABCDE&quot;,&quot;316067107&quot;-&gt;&quot;EFGHI&quot;)
    def getRandomElement(seq: Map[String,String]): Map[String,String] = {
  
      seq(Random.nextInt(seq.length))
    } 
   var outList = List.empty[Map[String,String]]
   for(i&lt;-0 to 1000){
     outList+=getRandomElement(testMap)
   }
   print(outList)
  }
  </code></pre>
  <p>The Output should generate 1000 Key-val pairs of map like i am showing below</p>
  <pre><code>[3875835,ABCDE]
  [316067107,EFGHI]
  [3875835,ABCDE]
  [316067107,EFGHI]
  [316067107,EFGHI]
  ............
  ............
  ............. upto 1000 random key-val pairs
  </code></pre>
  <p>Please help me figure out where i am going wrong and let me know How to resolve it, if any issue regarding the requirement, please feel free to comment for it</p>