ExtensionResponse { public static ExtensionResponse ok(final Map result) { if (result == null) { throw new IllegalArgumentException("result cannot be null"); } return ok(new JSONObject(result)); } ExtensionResponse(final Response response);  ExtensionResponse(final Response response, final boolean errorResponse); static ExtensionResponse override(final Response response); static ExtensionResponse error(final String message); static ExtensionResponse error(final String message, final String appendKey, final JSONObject appendJson); static ExtensionResponse error(final String message, final JSONObject appendJson); static ExtensionResponse error(final Exception source); static ExtensionResponse error(final Exception source, final String appendKey, final JSONObject appendJson); static ExtensionResponse error(final Exception source, final JSONObject appendJson); static ExtensionResponse error(final String message, final Exception source); static ExtensionResponse error(final String message, final Exception source, final String appendKey, final JSONObject appendJson); static ExtensionResponse error(final String message, final Exception source, final JSONObject appendJson); static ExtensionResponse error(final String message, final Exception source, final int statusCode); static ExtensionResponse error(final String message, final Exception source, final int statusCode,
                                          final String appendKey, final JSONObject appendJson); static ExtensionResponse noContent(); static ExtensionResponse ok(final Map result); static ExtensionResponse ok(final Element result); static ExtensionResponse ok(final Element result, final Set<String> propertyKeys, final GraphSONMode mode); static ExtensionResponse ok(final Iterator<Element> result); static ExtensionResponse ok(final Iterator<Element> result,
                                       final Set<String> propertyKeys, final GraphSONMode mode); static ExtensionResponse availableOptions(final String... methods); static ExtensionResponse ok(final JSONObject result); static ExtensionResponse badRequest(final String message, final JSONObject appendJson); static ExtensionResponse badRequest(); Response getJerseyResponse(); boolean isErrorResponse();  }
@Test(expected = IllegalArgumentException.class) public void okWithNullHashMap() { ExtensionResponse.ok((HashMap) null); }