title: Using scala.collection.immutable.Map inside my java class
body: <p>I get bellow exception from my java codes.</p>
  
  <pre><code> java.lang.ClassCastException: scala.collection.immutable.Map$Map1 cannot be cast to java.util.HashMap
      at au.com.vroc.udf.medianUDF.update(medianUDF.java:79)
  </code></pre>
  
  <p>I am getting error in my spark application when I cast the buffer to HashMap of java.utill. This is my codes:</p>
  
  <pre><code>    public void update(MutableAggregationBuffer buffer, Row input) {
      if (!input.isNullAt(0)) {   
  
          HashMap currentBuffer=(HashMap) buffer.get(0);//getting exception here
          //HashMap currentBuffer=new HashMap();  
          currentBuffer.put(input.getLong(0), input.getDouble(0));
  
          //currentBuffer.add(currentMap);
  
          buffer.update(0, currentBuffer);
  
      }
  }
  </code></pre>
  
  <p>I guess instead of java hashmap I have to use "scala.collection.immutable.Map$Map1" inside my java class. Can I use any tool in "JavaConversions" namespace. </p>
  
  <p>Anyhep would be appreciated!</p>