@Test
@SuppressWarnings("unchecked")
void explainServiceTest() {

    List<PredictInput> inputs = singletonList(createInput(40));
    List<PredictOutput> outputs = (List<PredictOutput>) resource.predict(inputs).getBody();
    assertNotNull(outputs);
    assertEquals(1, outputs.size());
    PredictOutput output = outputs.get(0);
    assertNotNull(output.getResult());
    assertNotNull(output.getModelIdentifier());
    Map<String, Object> result = output.getResult();
    assertTrue(result.containsKey("Should the driver be suspended?"));
    assertEquals("Yes", result.get("Should the driver be suspended?"));
    assertTrue(result.containsKey("Fine"));
    Map<String, Object> expectedFine = new HashMap<>();
    expectedFine.put("Points", BigDecimal.valueOf(7));
    expectedFine.put("Amount", BigDecimal.valueOf(1000));
    assertEquals(expectedFine.get("Points"), ((Map<String, Object>)result.get("Fine")).get("Points"));
    assertEquals(expectedFine.get("Amount"), ((Map<String, Object>)result.get("Fine")).get("Amount"));
}