title: scala json serialization missing fields (json4s)
body: <p>I am using json4s to serialize some scala map objects.</p>
  
  <pre><code>import org.apache.spark.util.StatCounter
  import org.json4s.DefaultFormats
  
  val m: scala.collection.Map[String, Map[String, StatCounter]] = Map("key" -&gt; Map("secondKey" -&gt; StatCounter()))
  
  implicit val format = DefaultFormats
  import org.json4s.jackson.Serialization.write
  
  println(m)
  println(write(m))
  </code></pre>
  
  <p>Correct result would be:</p>
  
  <pre><code>Map(key -&gt; Map(secondKey -&gt; (count: 0, mean: 0,000000, stdev: NaN, max: -Infinity, min: Infinity)))
  </code></pre>
  
  <p>strangely I get only for the serialized class</p>
  
  <pre><code>{"key":{"secondKey":{}}}
  res1: Unit = ()
  </code></pre>
  
  <p>How to get it serialize correctly?</p>