RequestObjectHelper { public static boolean hasElementProperties(final JSONObject requestObject) { if (requestObject == null) { return false; } final Iterator keys = requestObject.keys(); while (keys.hasNext()) { final String key = keys.next().toString(); if (!key.startsWith(Tokens.UNDERSCORE)) { return true; } } return false; }  static JSONObject getRexsterRequest(final JSONObject requestObject); static Set<String> getReturnKeys(final JSONObject requestObject); static Set<String> getReturnKeys(final JSONObject requestObject, final String wildcard); static Set<String> getReturnKeys(final JSONArray arrayOfKeys, final String wildcard); static boolean getShowTypes(final JSONObject requestObject); static Long getStartOffset(final JSONObject requestObject); static Long getEndOffset(final JSONObject requestObject); static boolean hasElementProperties(final JSONObject requestObject); static void buildQueryProperties(final JSONObject requestObject, final VertexQuery query);  }
@Test public void hasElementPropertiesTrue() { JSONObject requestObject = buildJSONObjectFromString("{\"_id\": 1, \"name\":\"wally\" }"); Assert.assertTrue(RequestObjectHelper.hasElementProperties(requestObject)); }
@Test public void hasElementPropertiesFalse() { JSONObject requestObject = buildJSONObjectFromString("{\"_id\": 1 }"); Assert.assertFalse(RequestObjectHelper.hasElementProperties(requestObject)); }
@Test public void hasElementPropertiesNullRequestFalse() { Assert.assertFalse(RequestObjectHelper.hasElementProperties(null)); }