@Test
public void testUnwrap() {

    assertNull("null unwrap to null", unwrap(null));
    assertNull("JsonObject.NULL unwrap to null", unwrap(JsonObject.NULL));
    assertEquals("JsonString unwrap to string", "foo", unwrap(wrap("foo")));
    assertEquals("JsonNumber unwrap to number", 100L, unwrap(wrap(100)));
    List<String> ordinals = Arrays.asList("one", "two", "three");
    assertEquals("unwrap a jsonarray to a List of objects", ordinals,
            unwrap(Json.createArrayBuilder().add("one").add("two").add("three").build()));
    Map<String, Object> someMap = Collections.singletonMap("foo", 5L);
    assertEquals("unwrap a jsonobject to a Map of String to Object", someMap,
            unwrap(Json.createObjectBuilder().add("foo", 5L).build()));
    assertTrue("unwrap JsonObject.TRUE to true",
            Optional.ofNullable(unwrap(JsonObject.TRUE)).map(Boolean.class::cast).orElse(false));
    assertFalse("unwrap JsonObject.FALSE to false",
            Optional.ofNullable(unwrap(JsonObject.FALSE)).map(Boolean.class::cast).orElse(true));
}