title: Issue using JSON library of Vert.x when I use json.encode
body: <p>I am trying to use <code>json.encode</code> of <code>vert.x</code> and am having a weird issue.
  I am new with <code>vert.x</code> so I really need help here.
  This line of code is the one that causes me a problem: <code>resp.setData(Json.encode(trustBalancingOutputDataListResult));</code></p>
  
  <p>I am trying to call <code>json.encode</code> by passing my <code>arrayList</code> of object type <code>TrustBalancingOutputData</code>.</p>
  
  <p>My object type <code>TrustBalancingOutputData</code> has 3 attributes type <code>HashMap</code> and it throws me the following exception:</p>
  
  <pre><code>Jun 05, 2019 8:46:33 AM io.vertx.core.impl.ContextImpl
  SEVERE: Unhandled exception
  java.lang.ClassCastException: java.util.LinkedHashMap cannot be cast to com.fma.wb.integration.reportsmodule.dto.trust.TrustBalancingOutputData
  at java.util.stream.Collectors.lambda$groupingBy$45(Collectors.java:907)
  at java.util.stream.ReduceOps$3ReducingSink.accept(ReduceOps.java:169)
  at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1382)
  at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
  at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
  at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
  at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
  at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499)
  at com.fma.wb.integration.reportsmodule.utils.io.TrustExcelFileGenerator.getBase64GeneratedFile(TrustExcelFileGenerator.java:47)
  at com.fma.wb.integration.reportsmodule.verticles.MainReportVerticle.lambda$null$17(MainReportVerticle.java:455)
  at io.vertx.core.impl.FutureImpl.tryComplete(FutureImpl.java:121)
  at io.vertx.core.impl.FutureImpl.complete(FutureImpl.java:83)
  at com.fma.wb.integration.reportsmodule.services.TrustBalancingService.lambda$calculateRpTotals$24(TrustBalancingService.java:1190)
  at io.vertx.core.impl.FutureImpl.setHandler(FutureImpl.java:76)
  at io.vertx.core.impl.ContextImpl.lambda$null$0(ContextImpl.java:289)
  at io.vertx.core.impl.ContextImpl.lambda$wrapTask$2(ContextImpl.java:339)
  at io.vertx.core.impl.TaskQueue.run(TaskQueue.java:76)
  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
  at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
  at java.lang.Thread.run(Thread.java:748)
  </code></pre>
  
  <p>I have tried to remove the 3 attributes type <code>HashMap</code> I have in my object <code>TrustBalancingOutputData</code> and I do not have an issue at all. That confirms me that the issue I have here is based on the 3 attributes type <code>HashMap</code> I have in my <code>TrustBalancingOutputData</code> object</p>
  
  <p>Here is my code:</p>
  
  <pre><code>InternalResponse resp=new InternalResponse();
  resp.setCause(1);
  resp.setData(Json.encode(trustBalancingOutputDataListResult));
  </code></pre>
  
  <p><code>trustBalancingOutputDataListResult</code> is an <code>ArrayList&lt;TrustBalancingOutputData&gt;</code>
  and <code>TrustBalancingOutputData</code> has the following attributes:</p>
  
  <pre><code>private HashMap&lt;String,String&gt; listTrust =  new HashMap&lt;&gt;();
      private String achTotal;
      private String iclTotal;
      private String rpSolutionsTotal;
      //private String formula = "";
      private HashMap&lt;String, ArrayList&lt;String&gt;&gt; excelFileBottomData = new HashMap&lt;&gt;();
  </code></pre>
  
  <p>I expect that my <code>trustBalancingOutputDataListResult arrayList</code> can be converted to a string when I call <code>Json.encode(trustBalancingOutputDataListResult)</code></p>