HttpErrorResponseException extends RuntimeException { @Override public boolean equals(Object object) { if (this == object) { return true; } if (object == null || getClass() != object.getClass()) { return false; } HttpErrorResponseException that = (HttpErrorResponseException) object; return statusCode == that.getStatusCode(); } HttpErrorResponseException(int statusCode, String statusDescription, String responseMessage);  HttpErrorResponseException(String message, int statusCode, String statusDescription, String responseMessage);  HttpErrorResponseException(String message, Throwable cause, int statusCode, String statusDescription, String responseMessage);  HttpErrorResponseException(Throwable cause, int statusCode, String statusDescription, String responseMessage); protected  HttpErrorResponseException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace, int statusCode,
        String statusDescription, String responseMessage); int getStatusCode(); String getStatusDescription(); String getResponseMessage(); @Override String toString(); @Override boolean equals(Object object); @Override int hashCode();  }
@Test public void testEquals() { HttpErrorResponseException testHttpErrorResponseException = new HttpErrorResponseException(testMessage, testStatusCode, testStatusDescription, testResponseMessage); Object nullObject = null; assertTrue(testHttpErrorResponseException.equals(testHttpErrorResponseException)); assertFalse(testHttpErrorResponseException.equals(nullObject)); assertFalse(testHttpErrorResponseException.equals("")); assertTrue(testHttpErrorResponseException.equals(new HttpErrorResponseException(testStatusCode, null, null))); }