@Test
public void testArr() {

    JsonArray array = arr().get();
    assertNotNull("arr().get() results in non-null JsonArray", array);
    assertTrue("arr().get() results in empty JsonArray", !array.iterator().hasNext());
    JsonArray nullArray = arr((Object[]) null).get();
    assertNotNull("arr(null).get() results in non-null JsonArray", nullArray);
    assertTrue("arr(null).get() results in empty JsonArray", !nullArray.iterator().hasNext());
    assertEquals("easy numerical sequence",
            "[0,1,2,3,4]", arr(0, 1, 2, 3, 4).get().toString());
    assertEquals("easy numerical sequence as vals",
            "[0,1,2,3,4]",
            arr(val(0), val(1), val(2), val(3), val(4)).get().toString());
    assertEquals("easy numerical sequence as dotted vals",
            "[0,1,2,3,4]",
            arr().val(0).val(1).val(2).val(3).val(4).get().toString());
    assertEquals("easy numerical sequence as dotted vals, no arr() initiator",
            "[0,1,2,3,4]",
            val(0).val(1).val(2).val(3).val(4).get().toString());
    assertEquals("numerical sequence as arr().and()",
            "[0,1,2,3,4]", arr(0, 1).and(2, 3, 4).get().toString());
    assertEquals("arr().opt(null) should leave empty object",
            Json.createArrayBuilder().build(), arr().opt(null).get());
    assertEquals("arr().opt(null, ifNotValue) should return with JsonObject.NULL when ifNotValue is provided",
            Json.createArrayBuilder().add(JsonValue.NULL).build(),
            arr().opt(null, "value").get());
    assertEquals("arr().opt(obj()) should leave empty object",
            Json.createArrayBuilder().build(),
            arr().opt(obj()).get());
    assertEquals("arr().opt(arr()) should leave empty object",
            Json.createArrayBuilder().build(),
            arr().opt(arr()).get());
    assertEquals("arr().opt(JsonObject.NULL) should leave empty object",
            Json.createArrayBuilder().build(),
            arr().opt(JsonObject.NULL).get());
    assertEquals("arr().opt(string) should return object with key",
            Json.createArrayBuilder().add("value").build(),
            arr().opt("value").get());
    assertEquals("arr().opt(string, default) should return object with key",
            Json.createArrayBuilder().add("value").build(),
            arr().opt("value", "notValue").get());
    assertEquals("arr().opt(string, ifNotValue) should return object with key when value is not ifNotValue",
            Json.createArrayBuilder().add("value").build(),
            arr().opt("value", "notValue").get());
    assertEquals("arr().opt(string, ifNotValue) should return empty object when value is ifNotValue",
            Json.createArrayBuilder().build(),
            arr().opt("value", "value").get());
}