### Question:
RestAuthX509CallbackHandler extends AbstractRestAuthCallbackHandler<X509CertificateCallback> { public JsonValue convertToJson(X509CertificateCallback callback, int index) throws RestAuthException { throw new RestAuthException(ResourceException.BAD_REQUEST, new UnsupportedOperationException( "X509Certificate must be specified in the initial request. Cannot be converted into a JSON " + "representation.")); }  boolean updateCallbackFromRequest(HttpServletRequest request,
            HttpServletResponse response, X509CertificateCallback callback); X509CertificateCallback handle(HttpServletRequest request, HttpServletResponse response,
            JsonValue postBody, X509CertificateCallback originalCallback); String getCallbackClassName(); JsonValue convertToJson(X509CertificateCallback callback, int index); X509CertificateCallback convertFromJson(X509CertificateCallback callback, JsonValue jsonCallback);  }### Answer:
@Test (expectedExceptions = RestAuthException.class) public void shouldFailConvertToJson() throws RestAuthException { restAuthX509CallbackHandler.convertToJson(null, 1); fail(); }