HttpErrorResponseException extends RuntimeException { @Override public String toString() { StringBuilder stringBuilder = new StringBuilder(); addTextToString("Message: " + getMessage(), stringBuilder); addTextToString("Status Code: " + statusCode, stringBuilder); addTextToString("Status Description: " + statusDescription, stringBuilder); addTextToString("Response Message: " + responseMessage, stringBuilder); return stringBuilder.toString(); } 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 testToString() { HttpErrorResponseException testHttpErrorResponseException = new HttpErrorResponseException(testMessage, testStatusCode, testStatusDescription, testResponseMessage); String expectedHttpErrorResponseExceptionString = String .format("Message: %s, Status Code: %d, Status Description: %s, Response Message: %s", testMessage, testStatusCode, testStatusDescription, testResponseMessage); assertEquals(expectedHttpErrorResponseExceptionString, testHttpErrorResponseException.toString()); }