public static ErrorResponse fromJson(int code, String json) {
    return JsonUtil.parse(json, node -> OAuthErrorResponseParser.fromJson(code, node));
  }
@Test
  public void testOAuthErrorResponseFromJsonWithNulls() {
    String error = OAuth2Properties.INVALID_CLIENT_ERROR;
    String json = String.format("{\"error\":\"%s\"}", error);
    ErrorResponse expected = ErrorResponse.builder().responseCode(400).withType(error).build();
    assertEquals(expected, OAuthErrorResponseParser.fromJson(400, json));

    // test with explicitly set nulls
    json = String.format("{\"error\":\"%s\",\"error_description\":null,\"error_uri\":null}", error);
    assertEquals(expected, OAuthErrorResponseParser.fromJson(400, json));
  }