@Test
public void names() {

    JSONObject obj = new JSONObject(of("foo", 1, "bar", 2, "baz", 3));
    JSONArray names = obj.names();
    assertEquals(
            newHashSet("foo", "bar", "baz"),
            newHashSet(names.toList())
    );
}