@Test
public void testObj() {

    JsonObject object = obj().get();
    assertNotNull("obj().get() results in non-null JsonObject", object);
    assertTrue("obj().get() results in empty JsonObject", object.keySet().isEmpty());
    JsonObject nullJSON = obj((JsonObject) null).get();
    assertNotNull("obj((JsonObject) null).get() results in non-null JsonObject", nullJSON);
    assertTrue("obj((JsonObject) null).get() results in empty JsonObject", nullJSON.keySet().isEmpty());
    JsonObject reJSON = obj(key("color", "red").get()).get();
    assertEquals("JsonObject to obj to JsonObject", "red", reJSON.getString("color"));
    Map<String, Object> reMap = new HashMap<>();
    reMap.put("color", "blue");
    JsonObject reMapJSON = obj(reMap).get();
    assertEquals("Map to obj to JsonObject", "blue", reMapJSON.getString("color"));
    assertEquals("obj deep equals obj(key, key) : obj().key(key, val).key(key2, val2)",
            obj(key("foo", "bar"), key("foo2", "bar2")).get(),
            obj().key("foo", "bar").key("foo2", "bar2").get());
    assertEquals("obj deep equals obj(key, key) : obj(key(key, val)).and(key(key2, val2))",
            obj(key("foo", "bar"), key("foo2", "bar2")).get(),
            obj(key("foo", "bar")).and(key("foo2", "bar2")).get());
    assertEquals("obj.arrKeys() retains order and duplicates",
            "[\"one\",\"two\",\"three\",\"two\"]",
            key("one", 1).key("two", 2).key("three", 3).key("two", -2).arrKeys().get().toString());
    assertEquals("obj.arrVals() retains order and duplicates",
            "[1,2,3,-2]",
            key("one", 1).key("two", 2).key("three", 3).key("two", -2).arrVals().get().toString());
    assertEquals("key(string).opt(null) should leave empty object",
            Json.createObjectBuilder().build(), obj().key("key").opt(null).get());
    assertEquals("key(string).opt(null, ifNotValue) should return key and JsonObject.NULL when ifNotValue is provided",
            Json.createObjectBuilder().add("key", JsonValue.NULL).build(),
            obj().key("key").opt(null, "value").get());
    assertEquals("key(string).opt(obj()) should leave empty object",
            Json.createObjectBuilder().build(), obj().key("key").opt(obj()).get());
    assertEquals("key(string).opt(arr()) should leave empty object",
            Json.createObjectBuilder().build(), obj().key("key").opt(arr()).get());
    assertEquals("key(string).opt(JsonObject.NULL) should leave empty object",
            Json.createObjectBuilder().build(), obj().key("key").opt(JsonObject.NULL).get());
    assertEquals("key(string).opt(string) should return object with key",
            Json.createObjectBuilder().add("key", "value").build(),
            obj().key("key").opt("value").get());
    assertEquals("key(string).opt(string, default) should return object with key",
            Json.createObjectBuilder().add("key", "value").build(),
            obj().key("key").opt("value", "notValue").get());
    assertEquals("key(string).opt(string, ifNotValue) should return object with key when value is not ifNotValue",
            Json.createObjectBuilder().add("key", "value").build(),
            obj().key("key").opt("value", "notValue").get());
    assertEquals("key(string).opt(string, ifNotValue) should return empty object when value is ifNotValue",
            Json.createObjectBuilder().build(),
            obj().key("key").opt("value", "value").get());
}