Map orderHash = buildOrderMap();
FromMapToJava transformer = new FromMapToJava();
transformer.setTo(JavaTypes.toMessageType(Order.class));
Order order = (Order) transformer.transform(orderHash);
Assert.assertEquals(1234, order.getHeader().getOrderId());
Assert.assertEquals("catalog", order.getHeader().getOriginType());
Assert.assertEquals(1234, order.getHeader().getCustomerDetails().getCustId());
Assert.assertEquals("Seamus Ungabunga", order.getHeader().getCustomerDetails().getName());
List<Item> items = order.getItems();
Assert.assertEquals(2, items.size());
Assert.assertEquals((Integer) 1234, items.get(0).getItemId());
Assert.assertEquals("X", items.get(0).getProductId());
Assert.assertEquals((Integer) 1235, items.get(1).getItemId());
Assert.assertEquals("Y", items.get(1).getProductId());