MANAGED_CLASS_MAPPING_ERROR given javaClass 'class java.util.ArrayList' is mapped to ListType, expected ManagedType
<p>We are starting to experiment with JaVers in our application.  We want to track changes to orders after they are placed by users.  So it's your typical order object with the main order object, items, item options, etc.  About half the time we go to run the test program we are receiving this exception:</p>

<blockquote>
  <p>130 [main] INFO org.javers.core.JaversBuilder - JaVers instance is up
  &amp; ready Exception in thread "main" JaversException:
  MANAGED_CLASS_MAPPING_ERROR given javaClass 'class
  java.util.ArrayList' is mapped to ListType, expected ManagedType  at
  org.javers.core.metamodel.type.TypeMapper.getJaversManagedType(TypeMapper.java:149)
    at
  org.javers.core.metamodel.type.TypeMapper.getJaversManagedType(TypeMapper.java:132)
    at
  org.javers.core.metamodel.object.GlobalIdFactory.createId(GlobalIdFactory.java:39)
    at
  org.javers.core.graph.LiveCdoFactory.create(LiveCdoFactory.java:24)
    at org.javers.core.graph.EdgeBuilder.asCdo(EdgeBuilder.java:39)     at
  org.javers.core.graph.EdgeBuilder.buildSingleEdge(EdgeBuilder.java:32)
    at
  org.javers.core.graph.ObjectGraphBuilder.buildSingleEdges(ObjectGraphBuilder.java:81)
    at
  org.javers.core.graph.ObjectGraphBuilder.buildEdges(ObjectGraphBuilder.java:71)
    at
  org.javers.core.graph.ObjectGraphBuilder.buildGraphFromCdo(ObjectGraphBuilder.java:59)
    at
  org.javers.core.graph.ObjectGraphBuilder.buildGraph(ObjectGraphBuilder.java:48)
    at
  org.javers.core.graph.LiveGraphFactory.createLiveGraph(LiveGraphFactory.java:39)
    at org.javers.core.diff.DiffFactory.buildGraph(DiffFactory.java:109)
    at org.javers.core.diff.DiffFactory.compare(DiffFactory.java:64)    at
  org.javers.core.JaversCore.compare(JaversCore.java:104)</p>
</blockquote>

<p>We just rerun the program and eventually it works.  The code basically looks like this.</p>

<pre><code>// Original database object
OrderVO oldOrder = // load from database.

// Changed database object
OrderVO newOrder = // load from database.
// Change the email
newOrder.setEmail("test@test.com");
// Simulate changing quantity and item id on items
for (OrderItemVO OrderItemVO : newOrder.getItems()) {
  OrderItemVO.setMerchantItemId(OrderItemVO.getMerchantItemId() + "A");
  OrderItemVO.setQuantity(OrderItemVO.getQuantity().add(1));
}

// Remove the first item
OrderItemVO[] items = new OrderItemVO[newOrder.getItems().length - 1];
System.arraycopy(newOrder.getItems(), 1, items, 0, items.length);
newOrder.setItems(items);

// Run comparison
Javers javers = JaversBuilder.javers().withListCompareAlgorithm(ListCompareAlgorithm.LEVENSHTEIN_DISTANCE).build();
Diff diff = javers.compare(oldOrder, newOrder);
</code></pre>