### Question:
BadRequestErrorResponse implements EscrowAgentErrorResponse { @Override public EscrowAgentErrorResponseException getErrorResponseException( final String errorResponse) { if (errorResponse.split("registration_error=").length == 2) return new RegistrationFailedException( errorResponse.split("registration_error=")[1]); return new EscrowAgentErrorResponseException(MESSAGE + " Status code: " + ERROR_CODE); }  @Override EscrowAgentErrorResponseException getErrorResponseException(
            final String errorResponse);  }### Answer:
@Test(expected = RegistrationFailedException.class) public void testRegistrationFailedException() throws EscrowAgentErrorResponseException { EscrowAgentErrorResponseException ex = new BadRequestErrorResponse() .getErrorResponseException("registration_error=failed"); Assert.assertEquals(ex.getMessage(), "failed"); throw ex; }
@Test(expected = EscrowAgentErrorResponseException.class) public void testEscowAgentErrorResponse() throws EscrowAgentErrorResponseException { EscrowAgentErrorResponseException ex = new BadRequestErrorResponse() .getErrorResponseException("error=error"); throw ex; }